Sub Ch4_ExplodePolyline()
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.SetBulge 3, -0.5
plineObj.Update
' 分解多段线
Dim explodedObjects As Variant
explodedObjects = plineObj.Explode
' 遍历分解的对象
' 并以消息框来显示
' 每个对象的类型
Dim I As Integer
For I = 0 To UBound(explodedObjects)
explodedObjects(I).Update
MsgBox "Exploded Object " & I & ": " & _
explodedObjects(I).ObjectName
explodedObjects(I).Update
Next
End Sub
vba帮助里面的东东 如果块很多 就用数组来存储explodedObjects |