orazio 发表于 2011-1-18 11:44:44

请问如何取AcadLWPolyline里的弧段属性?

在cad输入Pline时,可以开始画线,再输入a 回车,
就可以在连续线内开始画孤,
可是当从程式里取AcadLWPolyline的属性时,
我只有找到坐标阵列,记录每个点,
弧的中心点,半径,在哪一个属性?
请各位告诉我。或是告诉我如何知道AcadLWPolyline里是否有弧段?
谢谢大家。

fjfhgdwfn 发表于 2011-1-20 20:15:28

Sub Example_GetBulge()
    ' This example creates a lightweight polyline in model space.
    ' It then finds and changes the bulge for a given segment.
   
    Dim plineObj As AcadLWPolyline
    Dim points(0 To 11) As Double
   
    ' Define the 2D polyline points
    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
      
    ' Create a lightweight Polyline object in model space
    Set plineObj = ThisDrawing.ModelSpace.AddLightWeightPolyline(points)
    ZoomAll
   
    ' Find the bulge of the third segment
    Dim currentBulge As Double
    currentBulge = plineObj.GetBulge(3)
    MsgBox "The bulge for the third segment is " & plineObj.GetBulge(3), , "GetBulge Example"
   
    ' Change the bulge of the third segment
    plineObj.SetBulge 3, -0.5
    plineObj.Update
    MsgBox "The bulge for the third segment is now " & plineObj.GetBulge(3), , "GetBulge Example"
   
End Sub
多看看帮助

乖乖的过个好年 发表于 2011-6-8 16:16:54

这个没有回答上面的问题吧!

Exlw 发表于 2015-8-29 10:12:20

vba没有list的功能,但是可以计算出来。如下:
首先获取该点的凸度,getbulge
如果不为0,继续获取下一点坐标
通过这两点和凸度,就可以出半径,圆心坐标了

jikasurvey 发表于 2015-8-30 18:07:08

你要的数据只能通过圆弧段的凸度计算出来,凸度是圆心角的1/4正切值,凸度为正时圆弧为逆时针方向,为负时,圆弧为顺时针方向,为0时,该断为直线段.有了圆心角你就可以计算出半径和圆心坐标了!公式自己去查吧!

jikasurvey 发表于 2015-8-30 18:08:40

哎,四年前的贴子了,我还回复个毛线啊!

zzyong00 发表于 2015-8-30 19:50:25

http://bbs.mjtd.com/forum.php?mod=redirect&goto=findpost&ptid=111783&pid=656515
页: [1]
查看完整版本: 请问如何取AcadLWPolyline里的弧段属性?