Vla-addleader
- 構文
- (vla-addleader vla-object PointsArray Annotation Type)
- 機能
- 引出線を作成する。
- 引数
-
- vla-object … VLA オブジェクト
- PointsArray … バリアント型(倍精度浮動小数点数型配列); 入力のみ
- 引出線を指定する 3D WCS 座標の配列。 引出線定義のために少なくとも 2 点を指定。 3 点目はオプション。
- Annotation … オブジェクト Tolerance、MText、BlockRef オブジェクト、または NULL
- Type … AcLeaderType 列挙型
- acAttributeModeLockPosition : 属性の位置をロック
- acAttributeModeMultipleLine : 複数行の属性を許可
- acLineNoArrow : 矢印なし線分
- acLineWithArrow : 矢印あり線分
- acSplineNoArrow : 矢印なしスプライン
- acSplineWithArrow : 矢印ありスプライン
- 戻り値
- 作成された引出線の VLAオブジェクト
- サンプル
(vl-load-com)
(defun c:Example_AddLeader()
;; このサンプルは、モデル空間に引出線を作成する
;; この引出線は、異尺度オブジェクトをアタッチしていない
(setq doc (vla-get-ActiveDocument (vlax-get-acad-object)))
(setq modelSpace (vla-get-ModelSpace doc))
(setq points (vlax-make-safearray vlax-vbDouble '(0 . 8)))
(vlax-safearray-fill points '(0 0 0
4 4 0
4 5 0
)
)
(setq leaderType acLineWithArrow)
;; 一時注釈オブジェクトを作成する
(setq point (vlax-3d-point 4 5 0))
(setq annotationObject (vla-AddMText modelSpace point 1 ""))
;; モデル空間に引出線を作成する
(setq leaderObj (vla-AddLeader modelSpace points annotationObject leaderType))
;; 一時的な注釈オブジェクトを削除し、最後にリーダーの座標調整
(vla-Erase annotationObject)
(vla-put-Coordinate leaderObj 2 (vlax-3D-point 4 5 0))
(vla-ZoomAll (vlax-get-acad-object))
)
(defun c:Example_MLeaderLine()
(setq doc (vla-get-ActiveDocument (vlax-get-acad-object)))
(setq points (vlax-make-safearray vlax-vbDouble '(0 . 5)))
(vlax-safearray-fill points '(1 1 0
4 4 0
))
(setq i 0)
(setq modelSpace (vla-get-ModelSpace doc))
(setq oML (vla-AddMLeader modelSpace points i))
(setq r (vla-AddLeader oML))
(vlax-safearray-put-element points 4 10)
(vla-AddLeaderLine oML r points)
(alert (strcat "LeaderCount = " (itoa (vla-get-LeaderCount oML))))
(vla-ZoomExtents (vlax-get-acad-object))
)
関連事項