
! script name: points.d/polar
! topic: create point using polar coordinates

!A
!A NAME:
!A
!A 	Polar
!A
!A DESCRIPTION:
!A
!A 	This script creates points that are defined in polar coordinates
!A 	( radius and an angle ).
!A
!A		X= Rcos(Angle)
!A		Y= Rsin(Angle)
!A		Z= Z
!A
!A~ image location - images/polarpt.gif
!A
!B INSTRUCTIONS:
!B
!B 	INPUT ABS RADIUS: Enter the distance from X=0 and Y=0 that the
!B 		point should be constructed.
!B 
!B 	INPUT ABS ANGLE: Enter the angular orientation of the point to
!B 		be constructed.
!B 
!B 	INPUT ABS Z: Enter the Z coordinate of the point.
!B

stat=ChangeLabelStr("ScriptNameStatus","Function: polar ")

DIM Answer$[256]
DIM Destination$[256]


DEG

ActivateUndo
Stat=SetXyzInput(WsPolarInput)
Ploop:Pt=XyzInput("INPUT",WsXyzInput)
IF (ExitScript(Destination$)) THEN Leave

Stat=SetLastPoint(Pt,WsXyzInput)
ActivateUndo
Stat= AdvanceUndoNumber("point")
Stat= AddItemToUndo(WsUBCreateMode,Pt)
GOTO Ploop

Leave:!
IF (NOT LEN(Destination$)) THEN
	 LOAD "typecontrol"
ELSE
	 LOAD Destination$
END IF
END
