我的理解是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 |