PolarPoint 方法 (ActiveX)
获取与给定点的指定角度和距离的点。 支持的平台:仅限 Windows 签名VBA: RetVal = object.PolarPoint(Point, Angle, Distance)
返回值 (RetVal)类型:变体(双打的三元素阵列) 3D WCS 与给定点的指定角度和距离坐标。 言论没有其他评论。 例子VBA: 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
可视化 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-11-1 08:30
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.