PolarPoint Example

Using Programming Languages other than 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)

End Sub