兰州人 发表于 2008-3-31 11:01:00

[讨论]多段线的凸度问题



使用下面程序,用getBugle就是少获得两个凸度数据。Sub pl()
Dim pll As AcadLWPolyline, ent As AcadEntity
Dim bulgeCollection As New Collection
Dim aa() As Double
Debug.Print
Set pll = ThisDrawing.ModelSpace.Item(ThisDrawing.ModelSpace.Count - 1)

'Debug.Print ent.ObjectName
Debug.Print UBound(pll.Coordinates)
ReDim aa(0 To (UBound(pll.Coordinates) + 1) / 3) As Double
For i = 0 To (UBound(pll.Coordinates) + 1) / 3 + 0
    Debug.Print i, pll.GetBulge(i)
    aa(i) = pll.GetBulge(i)
Next i
Dim Coord As Variant
Coord = pll.Coordinates
Debug.Print "--------------------"
For ii = 0 To bulgeCollection.Count - 1
    Debug.Print bulgeCollection.Item(ii + 1)
Next ii
Set pll = ThisDrawing.ModelSpace.AddLightWeightPolyline(Coord)
pll.Closed = True

pll.color = acMagenta
For ii = 0 To (UBound(pll.Coordinates) + 1) / 3 + 0
    'pll.SetBulge ii, bulgeCollection.Item(ii)
    pll.SetBulge ii, aa(ii)
Next ii
   
   
End Sub

fjfhgdwfn 发表于 2008-4-1 13:14:00

多段线闭合的问题。看看closed属性的帮助。

兰州人 发表于 2008-4-1 13:24:00

fjfhgdwfn发表于2008-4-1 13:14:00static/image/common/back.gif多段线闭合的问题。看看closed属性的帮助。

<p>closed = false 就少了两个凸度。明白了。</p>
页: [1]
查看完整版本: [讨论]多段线的凸度问题