
! script name: solids.d/circylinder
! 3dtopic: construct cylinder defined by a circle and length

!A
!A NAME:
!A
!A 	Cylinder: Circle
!A
!A DESCRIPTION:
!A
!A 	This script constructs a cylinder of specified length and the circle
!A 	picked will be used as one end of the cylinder and will determine the
!A 	radius and orientation of the cylinder.
!A
!A~ image location - images/circylinder.gif
!A
!B INSTRUCTIONS:
!B
!B 	PICK CIRCLE: Pick the circle to be used as one end of the cylinder
!B 		to be constructed.
!B
!B 	LENGTH: Enter the length of the cylinder to be constructed.
!B
!C NOTES:
!C
!C 	The U contours of a cylinder are the circles and the V contours are
!C 	the lines.
!C

Stat=ChangeLabelStr("ScriptNameStatus","Function: cylinder defined by a circle ")

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


ActivateUndo
Length=1.0

Cloop:!


pcircle=PickSpecificEnt("PICK CIRCLE",WsPickCircles)
IF ExitScript(Destination$) THEN Leave
IF NOT ValidGeometry(pcircle) THEN Cloop

Stat=SetInputFormat("n4=","")
Stat=SetEqualsValue(Length)
Length=GetValue("LENGTH",Answer$)
IF ExitScript(Destination$) THEN Leave

C1=CircleCylinder(Pcircle,Length)

ActivateUndo
Stat= AdvanceUndoNumber("cylinder")
Stat= AddItemToUndo(WsUBCreateMode,C1)
GOTO Cloop

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