Vla-put-tagstring
- 構文
- (vla-put-tagstring vla-object string )
- 機能
- オブジェクトのタグ文字列を指定する。
- 引数
-
- vla-object … VLAオブジェクト(Attribute、AttributeReference、PopupMenu、PopupMenuItem、Toolbar、ToolbarItem)
- string … オブジェクトのタグ文字列
- 戻り値
- nil
- MEMO:PopupMenu、Toolbar オブジェクトは読み込み専用
- Attribute、AttributeReference : 文字列は、属性を識別するためのもの。スペースと感嘆符以外のどんな文字でも使用できる。小文字は自動的に大文字に変更される。
- PopupMenu、PopupMenuItem、Toolbar, ToolbarItem: タグ(名前タグ)は、英数字とアンダースコア(_)文字で構成される文字列。この文字列によって、カスタマイズ ファイル内の項目が特定される。この文字列はオブジェクトの作成時に自動的に割り当てられ、ツールバーとメニューを識別するために CAD 内部で使用される。ほとんどの開発者は、このレベルの識別を必要としないため TagString プロパティは無視して問題ない。
- サンプル
(vl-load-com)
(defun c:Example_TagString()
;; モデル空間の属性定義を作成して、属性のタグ文字列をクエリし、
;; タグ文字列を変更盲信するサンプル
(setq acadObj (vlax-get-acad-object))
(setq doc (vla-get-ActiveDocument acadObj))
;; 属性定義の定義
(setq insertionPoint (vlax-3d-point 5 5 0)
attHeight 1
attMode acAttributeModeVerify
attPrompt "New Prompt"
attTag "NEW_TAG"
attValue "New Value")
;; 属性定義を作成
(setq modelSpace (vla-get-ModelSpace doc))
(setq attributeObj (vla-AddAttribute modelSpace attHeight attMode attPrompt insertionPoint attTag attValue))
(vla-ZoomAll acadObj)
;; 現在のタグ文字列を取得
(setq tag (vla-get-TagString attributeObj))
(alert (strcat "現在のタグ文字列は " tag))
;; 変更
(vla-put-TagString attributeObj "UPDATED_TAG")
(vla-Update attributeObj)
(setq tag (vla-get-TagString attributeObj))
(alert (strcat "新しいタグ文字列は " tag))
)
関連事項