
! script name: solids.d/nurbsphere
! 3dtopic: construct sphere as a nurb

!A
!A NAME:
!A
!A 	Sphere: Define as a nurb
!A
!A DESCRIPTION:
!A
!A 	This script will construct a nurb sphere of specified radius.
!A
!B INSTRUCTIONS:
!B
!B 	RADIUS: Enter the radius of the sphere to be constructed.
!B
!# see also - points.d/xyzinput.hlp

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

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=NurbSphere(Axis_line,Radius,1,Direction)

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

Leave:!

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