点の配列から Trace オブジェクトを作成します。
サポートされているプラットフォーム: Windows のみ
VBA:
RetVal = object.AddTrace(PointsArray)
タイプ: Block、ModelSpace、PaperSpace
このメソッドが適用されるオブジェクト。
アクセス: 入力のみ
タイプ: バリアント型(倍精度浮動小数点数型配列)
太線の端点を指定する 3D WCS 座標の配列。
太線の端点は常に中心線上にあり、直角に切断されます。AutoCAD は、隣接する線分に接続するための切り取り角度を自動的に計算します。
塗り潰し表示モードがオンの場合、太線は塗り潰されます。塗り潰し表示モードがオフの場合、太線の輪郭だけが表示されます。
塗り潰しモードを設定するには、AutoCAD のシステム変数 FILLMODE を使用します。AutoCAD のシステム変数 TRACEWID には、Trace オブジェクトに使用される現在の幅が格納されます。
VBA:
Sub Example_AddTrace()
' This example creates a trace in model space.
Dim traceObj As AcadTrace
Dim tracePts(0 To 11) As Double ' 4 (3D) points
' Define the points of the trace
tracePts(0) = 1: tracePts(1) = 1: tracePts(2) = 0
tracePts(3) = 3: tracePts(4) = 3: tracePts(5) = 0
tracePts(6) = 5: tracePts(7) = 3: tracePts(8) = 0
tracePts(9) = 5: tracePts(10) = 1: tracePts(11) = 0
' Turn on the system variable (FILLMODE)
' to fill the outline of the trace
ThisDrawing.SetVariable "FILLMODE", 1
' Create the trace object in model space
Set traceObj = ThisDrawing.ModelSpace.AddTrace(tracePts)
ZoomAll
End Sub
Visual LISP:
(vl-load-com)
(defun c:Example_AddTrace()
;; This example creates a trace in model space.
(setq acadObj (vlax-get-acad-object))
(setq doc (vla-get-ActiveDocument acadObj))
;; Define the points of the trace
(setq tracePts (vlax-make-safearray vlax-vbDouble '(0 . 11)))
(vlax-safearray-fill tracePts '(1 1 0
3 3 0
5 3 0
5 1 0
)
)
;; Turn on the system variable (FILLMODE)
;; to fill the outline of the trace
(vla-SetVariable doc "FILLMODE" 1)
;; Create the trace object in model space
(setq modelSpace (vla-get-ModelSpace doc))
(setq traceObj (vla-AddTrace modelSpace tracePts))
(vla-ZoomAll acadObj)
)