从点数组创建跟踪对象。 支持的平台:仅窗口 签名工 务 局: RetVal = object.AddTrace(PointsArray) 言论迹线的端点始终位于中心线上,并且始终被切割为正方形。AutoCAD 会自动计算与相邻追踪段连接的正确斜面。 当填充模式打开时,迹线是实心填充的。当“填充”模式关闭时,仅显示迹线的轮廓。 要设置填充模式,请使用 AutoCAD 填充模式系统变量。AutoCAD TRACEWID 系统变量存储用于对象的当前宽度。Trace 例子工 务 局: 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)
)
|
|Archiver|CAD开发者社区
( 苏ICP备2022047690号-1 苏公网安备32011402011833)
GMT+8, 2025-11-29 05:51
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.