
! script name: conics.d/spiralent
! topic: construct a spiral

!A
!A NAME:
!A
!A 	Spiral
!A
!A DESCRIPTION:
!A
!A 	This script constructs a spline curve through a spiral.
!A
!B INSTRUCTIONS:
!B
!B 	STARTING RADIUS OF SPIRAL: Enter the starting radius of the spiral
!B 		to be constructed.
!B
!B 	ENDING RADIUS OF SPIRAL: Enter the ending radius of the spiral to
!B 		be constructed.
!B
!B 	CENTER POINT ABS X,Y,Z: Enter the X,Y,Z coordinates of the center
!B 		point of the spiral.  NOTE: See XYZ INPUT OPTIONS.
!B
!B 	STARTING ANGLE: Enter the starting angle of the spiral.
!B
!B 	ANGULAR EXTENT: Enter the total number of degrees for the spiral
!B 		construction.
!B
!B 	Z START: Enter the Z coordinate of the start point of the spiral.
!B
!B 	Z END: Enter the Z coordinate of the end point of the spiral.
!B
!# see also - points.d/xyzinput.hlp

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

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

ActivateUndo
Start:!
Stat=SetInputFormat("n4","")

Start_rad=InputRadius("STARTING RADIUS OF SPIRAL")
IF (ExitScript(Destination$)) THEN Leave

End_rad=InputRadius("ENDING RADIUS OF SPIRAL")
IF (ExitScript(Destination$)) THEN Leave

Center=XyzInput("CENTER POINT",WsXyzInput)
IF (ExitScript(Destination$)) THEN Leave

Astart=InputAngle("STARTING ANGLE")
IF (ExitScript(Destination$)) THEN Leave

Angle=InputAngle("ANGULAR EXTENT")
IF (ExitScript(Destination$)) THEN Leave

Zstart=GetValue("Z START",Answer$)
IF (ExitScript(Destination$)) THEN Leave

Zend=GetValue("Z END",Answer$)
IF (ExitScript(Destination$)) THEN Leave


H1=Helix(Center,Start_rad,End_rad,Zstart,Zend,Astart,Angle)
Stat=DeleteEntity(Center)
ActivateUndo
Stat= AdvanceUndoNumber("spirial")
Stat= AddItemToUndo(WsUBCreateMode,H1)


GOTO Start


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

