使用PolarPoint 方法 获取与给定点指定角度和距离的点。 MSITStore:D:\acadauto(明经通道翻译的autocad%20vba帮助).chm::/polarpoint_see_also.htm">参阅 | MSITStore:D:\acadauto(明经通道翻译的autocad%20vba帮助).chm::/ex_polarpoint.htm">示例 语法 RetVal = PolarPoint(Point, Angle, Distance) Object MSITStore:D:\acadauto(明经通道翻译的autocad%20vba帮助).chm::/idh_utility_object.htm">Utility 使用该方法的对象。 Point Variant[变体] (三元素双精度数组); 仅用于输入 指定起点的三维WCS坐标。 Angle Double[双精度]; 仅用于输入 以弧度为单位的角度值。 Distance Double[双精度]; 仅用于输入 以当前单位为单位的距离值。 RetVal Variant[变体] (三元素双精度数组) 该三维WCS的坐标是根据相对给出点的距离和角度得到的坐标。 Sub Example_PolarPoint()
' This example finds the coordinate of a point that is a given
' distance and angle from a base point.
Dim polarPnt As Variant
Dim basePnt(0 To 2) As Double
Dim angle As Double
Dim distance As Double
basePnt(0) = 2#: basePnt(1) = 2#: basePnt(2) = 0#
angle = 0.1744444 ' 45 degrees
distance = 5
polarPnt = ThisDrawing.Utility.PolarPoint(basePnt, angle, distance)
' Create a line from the base point to the polar point
Dim lineObj As AcadLine
Set lineObj = ThisDrawing.ModelSpace.AddLine(basePnt, polarPnt)
ZoomAll
End Sub |