- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
i want to add offset to a poly line and flip horizontally (without moving) and explode.
But i have problem with object, which created with offset; Variable for offset is not a polyline, it is a variant.
Normal methods are not working with this object. I can not select the object, which created with offset. How can i create an object with offset and modify it?
My code is here:
Sub offset_and_flip()
' Create the polyline
Dim plineObj As AcadLWPolyline
Dim offsetObj As Variant
Dim points(0 To 7) As Double
points(0) = 0: points(1) = 0
points(2) = 0: points(3) = 2
points(4) = 2: points(5) = 2
points(6) = 4: points(7) = 0
Set plineObj = ThisDrawing.ModelSpace.AddLightWeightPolyline(points)
plineObj.Closed = True
' Define the mirror axis
Dim point1(0 To 2) As Double
Dim point2(0 To 2) As Double
point1(0) = 2: point1(1) = 3: point1(2) = 0
point2(0) = 2: point2(1) = 0: point2(2) = 0
'create offset
offsetObj = plineObj.Offset(-1)
' i get error message, if i write offsetObj instead of plineObj
Dim mirrorObj As AcadLWPolyline
Set mirrorObj = plineObj.Mirror(point1, point2)
plineObj.Erase
mirrorObj.Explode
End Sub
Solved! Go to Solution.