Vla-fieldcode
- 構文
- (vla-fieldcode vla-object ' ' ')
- 機能
- フィールド コードを含む文字列を返す。
- 引数
-
- vla-object … MText、Text の VLAオブジェクト
- 戻り値
- オブジェクトのフィールド コード。
- サンプル
(vl-load-com)
(defun c:Example_FieldCode()
;; モデル空間にフィールド付き文字列を作成して返すサンプル
(setq acadObj (vlax-get-acad-object))
(setq doc (vla-get-ActiveDocument acadObj))
;; text オブジェクトの設定
(setq insertionPoint (vlax-3d-point 2 2 0)
text "%<\\AcVar Date \\f \"yyyy/M/d\"%>%"
height 0.5)
;; text オブジェクトを作成
(setq modelSpace (vla-get-ModelSpace doc))
(setq textObj (vla-AddText modelSpace text insertionPoint height))
(vla-ZoomAll acadObj)
;; 文字列の内容を返す
(setq text (vla-FieldCode textObj))
(alert (strcat "文字列のフィールドコード : " text))
)
関連事項