
! script name: conics.d/helixent
! topic: make a helix entity

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

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

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

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

Radius=InputRadius("RADIUS OF HELIX")
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

Stat=SetPickReturn(WsGeometryZ)
Stat=SetInputFormat("n4=","")
Stat=SetEqualsValue(Zstart)
Zstart=GetValue("Z START",Answer$)
IF (ExitScript(Destination$)) THEN Leave
Stat=SetPickReturn(WsGeometryEnd)

Stat=SetInputFormat("n4=","")
Stat=SetEqualsValue(Zend)
Zend=GetValue("Z END",Answer$)
IF (ExitScript(Destination$)) THEN Leave
Stat=SetPickReturn(WsGeometryEnd)


H1=Helix(Center,Radius,Radius,Zstart,Zend,Astart,Angle)
ActivateUndo
Stat= AdvanceUndoNumber("helix")
Stat= AddItemToUndo(WsUBCreateMode,H1)

GOTO Start


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

