奇怪的问题-为什么offset后实体会回到原点附近位置?
奇怪的问题-为什么offset后实体会回到原点附近位置?dwg:
本来应该是这样的效果:
但实体却跑掉了,是不是图形环境有问题?
用这段程序:
Sub test()<BR> ' Begin the selection<BR> Dim returnObj As AcadObject<BR> 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"
<BR> Dim lwpl As AcadLWPolyline<BR> Set lwpl = returnObj
' Set lwpl = ThisDrawing.ModelSpace.AddLightWeightPolyline(pts)<BR>' lwpl.layer = "gxyz"
Dim offsetObj1 As Variant<BR> offsetObj1 = lwpl.offset(0.5)<BR> Dim offlwpl1 As AcadLWPolyline<BR> Set offlwpl1 = offsetObj1(0)<BR> offlwpl1.layer = "gxyz"<BR> Dim coords1 As Variant<BR> coords1 = offlwpl1.Coordinates
Dim offsetObj2 As Variant<BR> offsetObj2 = lwpl.offset(-2)<BR> Dim offlwpl2 As AcadLWPolyline<BR> Set offlwpl2 = offsetObj2(0)<BR> offlwpl2.layer = "gxyz"<BR> Dim coords2 As Variant<BR> coords2 = offlwpl2.Coordinates<BR>End Sub 本帖最后由 作者 于 2005-6-16 12:10:51 编辑
我运行了没问题啊,把捕捉关掉试试. 是的,我也遇到过这个问题,应该是vba的一个bug。
当时明总给出了一个解决方法,先在原位复制物体,然后在offset,再把复制的物体删除。 我也是,试过了,不是图的问题,不同的机器上结果不一样???一下午没搞定
页:
[1]