Vla-get-isxref
- 構文
- (vla-get-isxref vla-object)
- 機能
- 指定されたブロックが外部参照ブロックかどうかを取得する。
- 引数
-
- vla-object … Block の VLAオブジェクト
- 戻り値
- ブール型
- :vlax-True: 外部参照ブロック。
- :vlax-False: 外部参照ブロックではない。
- サンプル
(vl-load-com)
(defun c:Example_IsXref()
;; 図面内の各ブロック オブジェクトを作成して、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)
;; Block is simple
(setq msg (strcat msg (vla-get-Name tempBlock) ": レイアウトジオメトリを含む"))
)
)
(setq msg (strcat msg "\n"))
)
;; ブロックインフォメーションを表示
(alert (strcat "この図面のブロックは、次のスタイルを持っています : " msg))
)
関連事項