373294296 发表于 2016-1-5 17:01:55

如何用vba 快速的获取封闭多段线内每个夹角的度数????

如何用vba 快速的获取封闭多段线内每个夹角的度数????如图,,,每个顶点的坐标都获取到了, 但是不知道怎么去算度数???苦等高手求解???

zzyong00 发表于 2016-1-5 19:33:13

Utility的AngleFromXAxis

373294296 发表于 2016-1-6 14:12:09

AngleFromXAxis: 获取直线与 X 坐标轴的夹角。老师怎么理解???主要是不理解?

373294296 发表于 2016-1-11 21:34:40

   哦,好的三克油老师

wu112031853 发表于 2016-1-12 13:43:05

程序呢@!!!!!

373294296 发表于 2016-1-14 09:22:05

还没做出来呢???不会

373294296 发表于 2016-1-14 10:22:20


老师这是明经通道的例子, 得到的 Set lineObj 是弧度???但是弧度我转成角度为什么得到是315度呢???好像不对???生手哈    ! 数学没学好 哈 老师???Sub Example_AngleFromXAxis()
    ' This example finds the angle, in radians, between the X axis
    ' and a line defined by two points.
   Dim jd As Double
    Dim pt1(0 To 2) As Double
    Dim pt2(0 To 2) As Double
    Dim retAngle As Double
   Const PI = 3.141592654
    pt1(0) = 2: pt1(1) = 5: pt1(2) = 0
    pt2(0) = 5: pt2(1) = 2: pt2(2) = 0
   

    retAngle = ThisDrawing.Utility.AngleFromXAxis(pt1, pt2)
    jd = retAngle * 180 / PI
    Dim lineObj As AcadLine
    Set lineObj = ThisDrawing.ModelSpace.AddLine(pt1, pt2)
    ZoomAll
    MsgBox "The angle in radians between the X axis and the line is " & retAngle, , "AngleFromXAxis 示例"
   
End Sub

373294296 发表于 2016-1-19 23:18:46

数学是语文老师教的的,这下坏了坏了
页: [1]
查看完整版本: 如何用vba 快速的获取封闭多段线内每个夹角的度数????