
! script name: solids.d/nurbcylinder
! 3dtopic: construct cylinder of specified length, radius, and orientation

!A
!A NAME:
!A
!A 	Cylinder: Define as a nurb
!A
!A DESCRIPTION:
!A
!A 	This script will construct a nurb cylinder of specified length, radius,
!A 	and orientation at the specified center point.
!A
!B INSTRUCTIONS:
!B
!B 	RADIUS: Enter the radius of the cylinder to be constructed.
!B
!B
!B
!B
!C NOTES:
!C
!C 	The U contours of a nurb cylinder are the circles and the V
!C 	contours are the lines.
!C
!# see also - points.d/xyzinput.hlp

Stat=ChangeLabelStr("ScriptNameStatus","Function: nurb cylinder ")

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

ActivateUndo
Cloop:!

Stat=SetInputFormat("n4=","")
Stat=SetEqualsValue(1.00)
Radius=InputRadius("RADIUS")
IF ExitScript(Destination$) THEN Leave


Pick_axis:!
axis_line=PickSpecificEnt("PICK AXIS LINE",WsPickLines)
IF ExitScript(Destination$) THEN Leave
IF NOT ValidGeometry(axis_line) THEN pick_axis

T=LastPickPara
IF T<=0.5 THEN
        Direction= WsForward
ELSE
        Direction= WsReverse
END IF

C1=NurbCylinder(Axis_line,Radius,1,Direction)

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

Leave:!

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