Gets the point at a specified angle and distance from a given point.
Supported platforms: Windows only
VBA:
RetVal = object.PolarPoint(Point, Angle, Distance)
Type: Utility
The object this method applies to.
Access: Input-only
Type: Variant (three-element array of doubles)
The 3D WCS coordinates specifying the start point.
Access: Input-only
Type: Double
The angle in radians.
Access: Input-only
Type: Double
The distance in current units.
Type: Variant (three-element array of doubles)
The 3D WCS coordinates at the specified angle and distance from a given point.
No additional remarks.
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
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)
)