Offset Example

Using Programming Languages other than VBA

Sub Example_Offset()
	' This example creates a lightweight polyline
	' and then offsets the polyline.

	' Create the polyline
	Dim plineObj As AcadLWPolyline
	Dim points(0 To 11) As Double
	points(0) = 1: points(1) = 1
	points(2) = 1: points(3) = 2
	points(4) = 2: points(5) = 2
	points(6) = 3: points(7) = 2
	points(8) = 4: points(9) = 4
	points(10) = 4: points(11) = 1
	Set plineObj = ThisDrawing.ModelSpace.AddLightWeightPolyline(points)
	plineObj.Closed = True
	ZoomAll
		
	MsgBox "Offset the polyline by 0.25.", , "Offset Example"

	' Offset the polyline
	Dim offsetObj As Variant
	offsetObj = plineObj.offset(0.25)

	ZoomAll
	MsgBox "Offset completed.", , "Offset Example"

End Sub

 

   Comments?