Vla-get-islayout
- 構文
- (vla-get-islayout vla-object)
- 機能
- 指定されたブロックがレイアウト ブロックかどうかを取得する。
- 引数
-
- vla-object … Block の VLAオブジェクト
- 戻り値
- ブール型
- :vlax-True: レイアウト。
- :vlax-False: レイアウトではない。
- MEMO : IsLayout プロパティは IsXRef プロパティと一緒に機能する。両方のプロパティが False である場合、ブロックは単純なブロック。 IsXRef プロパティが True である場合、ブロックは外部参照。IsLayout プロパティが True である場合、ブロックはレイアウトに関連付けられたすべてのジオメトリを含む。
- サンプル
(vl-load-com)
(defun c:Example_islayout()
;; 図面内の各ブロック オブジェクトを作成して、IsLayout、IsXRef から
;; 各ブロックのスタイルを判断するサンプル。
(setq acadObj (vlax-get-acad-object))
(setq doc (vla-get-ActiveDocument acadObj))
;; ブロックの定義
(setq centerPoint (vlax-3d-point 0 0 0)
insertPoint (vlax-3d-point 1 1 0)
radius 0.5)
;; ブロックを作成
(setq newBlock (vla-Add (vla-get-Blocks doc) centerPoint "CBlock"))
;; ブロックに円を追加
(setq circleObj (vla-AddCircle (vla-Item (vla-get-Blocks doc) "CBlock") centerPoint radius))
;; ブロックをモデル空間に追加
(setq modelSpace (vla-get-ModelSpace doc))
(setq insertedBlock (vla-InsertBlock modelSpace InsertPoint "CBlock" 1 1 1 0))
(vla-ZoomAll acadObj)
(setq msg "")
(vlax-for tempBlock (vla-get-Blocks doc)
(cond
((and (= (vla-get-IsLayout tempBlock) :vlax-false)
(= (vla-get-IsXRef tempBlock) :vlax-false))
;; 単純なブロック
(setq msg (strcat msg (vla-get-Name tempBlock) ": 単純な"))
)
((= (vla-get-IsXRef tempBlock) :vlax-true)
;; 外部参照なブロック
(setq msg (strcat msg (vla-get-Name tempBlock) ": 外部参照"))
(if (= (vla-get-IsLayout tempBlock) :vlax-true)
;; レイアウトジオメトリなブロック
(setq msg (strcat msg (vla-get-Name tempBlock) " かつレイアウトジオメトリを含む"))
)
)
((= (vla-get-IsLayout tempBlock) :vlax-true)
;; レイアウトジオメトリ
(setq msg (strcat msg (vla-get-Name tempBlock) ": レイアウトジオメトリを含む"))
)
)
(setq msg (strcat msg "\n"))
)
;; ブロックインフォメーションを表示
(alert (strcat "この図面のブロックは、次のスタイルを持っています : " msg))
)
関連事項