Vla-getblockattributevalue
- 構文
- MLeader の場合: (vla-getblockattributevalue vla-object attdefID)
- Table の場合 (vla-getblockattributevalue vla-object row col attdefID)
- 機能
- MLeader オブジェクトまたは Table オブジェクトに含まれるブロック内の属性の属性値を取得する。
- 引数
MLeader の場合
- vla-object … MLeader の VLAオブジェクト
- attdefID … 属性定義 ID。(Long_PTR)
Table の場合
- vla-object … MLeader の VLAオブジェクト
- row … テーブル内の行。長整数型
- col … テーブル内の列。長整数型
- attdefID … 属性定義 ID。(Long_PTR)
- 戻り値
- 属性値。
- サンプル
(vl-load-com)
(defun c:Example_BlockAttribute()
;; マルチ引出線を作成してブロックの属性を変更するサンプル
(setq acadObj (vlax-get-acad-object))
(setq doc (vla-get-ActiveDocument acadObj))
(setq points (vlax-make-safearray vlax-vbDouble '(0 . 5)))
(vlax-safearray-fill points '(0 4 0
1.5 5 0
)
)
(setq i 0)
(setq modelSpace (vla-get-ModelSpace doc))
(setq oML (vla-AddMLeader modelSpace points i))
(vla-put-ContentType oML acBlockContent)
(vla-put-ContentBlockType oML acBlockBox)
(setq sBlock (vla-get-ContentBlockName oML))
(vlax-for o (vla-Item (vla-get-Blocks doc) sBlock)
(if (= (vla-get-ObjectName o) "AcDbAttributeDefinition")
(progn
(vla-SetBlockAttributeValue oML (vla-get-ObjectID o) "123")
(alert (vla-GetBlockAttributeValue oML (vla-get-ObjectID o)))
)))
(vla-Update acadObj)
(vla-ZoomExtents acadObj)
)
関連事項