AddTrace Example

Using Programming Languages other than 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

 

   Comments?