[求助]请问这张图的带红色的比较是如何解释的
我的理解是offsetObj实体经过offset处理后
offset应该变色的语句
offsetObj(0).color = acRed我也不明白,offsetObj(0)的定义是变体,写法是数组,想请教楼上的如何解释?
以下是Autocad自带帮助文件
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 是这样的,一个对象经过偏移,可能产生不只一个的新对象(如花生形的多段线向内偏移后,可能会产生两个闭合的对象),使用单个对象来接收新对象明显是不合适的,所以就需要使用对象数组来保存新对象了。
对了郑站长,那个MIRROR,不也可能产生不只一个的新对象吗?
“一个对象” 镜像,只能生成“一个新对象”;“一个对象”偏移,则有可能生成“一大堆新对象”。
试试对椭圆进行上述两操作就知道了……
页:
[1]