奇怪的问题-为什么offset后实体会回到原点附近位置?
dwg:
本来应该是这样的效果:
但实体却跑掉了,是不是图形环境有问题?
用这段程序:
Sub test() ' Begin the selection Dim returnObj As AcadObject Dim basePnt As Variant
On Error Resume Next
' The following example waits for a selection from the user
ThisDrawing.Utility.GetEntity returnObj, basePnt, "Select an object"
Dim lwpl As AcadLWPolyline Set lwpl = returnObj
' Set lwpl = ThisDrawing.ModelSpace.AddLightWeightPolyline(pts) ' lwpl.layer = "gxyz"
Dim offsetObj1 As Variant offsetObj1 = lwpl.offset(0.5) Dim offlwpl1 As AcadLWPolyline Set offlwpl1 = offsetObj1(0) offlwpl1.layer = "gxyz" Dim coords1 As Variant coords1 = offlwpl1.Coordinates
Dim offsetObj2 As Variant offsetObj2 = lwpl.offset(-2) Dim offlwpl2 As AcadLWPolyline Set offlwpl2 = offsetObj2(0) offlwpl2.layer = "gxyz" Dim coords2 As Variant coords2 = offlwpl2.Coordinates End Sub