获取与给定点保持指定角度和距离的点。 支持的平台:仅窗口 签名工 务 局: RetVal = object.PolarPoint(Point, Angle, Distance)
返回值(RetVal)类型:变体(双精度的三元素数组) 3D 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
Visual LISP: (vl-load-com)
(defun c:Example_PolarPoint()
;; This example finds the coordinate of a point that is a given
;; distance and angle from a base point.
(setq acadObj (vlax-get-acad-object))
(setq doc (vla-get-ActiveDocument acadObj))
(setq basePnt (vlax-3d-point 2 2 0)
ang 0.1744444 ;; 45 degrees
dist 5)
(setq polarPnt (vla-PolarPoint (vla-get-Utility doc) basePnt ang dist))
;; Create a line from the base point to the polar point
(setq modelSpace (vla-get-ModelSpace doc))
(setq lineObj (vla-AddLine modelSpace basePnt polarPnt))
(vla-ZoomAll acadObj)
)
|
|Archiver|CAD开发者社区
( 苏ICP备2022047690号-1 苏公网安备32011402011833)
GMT+8, 2025-10-29 14:21
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.