- 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) = 10001: points(1) = 10001
- points(2) = 10001: points(3) = 10002
- points(4) = 10002: points(5) = 10002
- points(6) = 10003: points(7) = 10002
- points(8) = 10004: points(9) = 10004
- points(10) = 10004: points(11) = 10001
- Set plineObj = ThisDrawing.ModelSpace.AddLightWeightPolyline(points)
- plineObj.Closed = True
- [b]Set plineObj = plineObj.Copy[/b]
- ZoomExtents
- ThisDrawing.Regen acActiveViewport
- MsgBox "Offset the polyline by 0.25.", , "Offset Example"
-
- ' Offset the polyline
- Dim offsetObj As Variant
- offsetObj = plineObj.Offset(0.25)
- [b]plineObj.Delete[/b]
- ThisDrawing.Regen acActiveViewport
-
- ZoomExtents
- MsgBox "Offset completed.", , "Offset Example"
-
- End Sub
|