
! script name: solids.d/radcircone
! 3dtopic: construct cone defined by circle, length, and end radius

!A
!A NAME:
!A
!A 	Cone:  Rad: Circle
!A
!A DESCRIPTION:
!A
!A 	This script constructs a cone of specified length and ending radius,
!A 	using the picked circle for the starting radius.  The picked circle
!A 	will determine the orientation of the axis line of the cone.
!A
!A~ image location - images/radcircone.gif
!A
!B INSTRUCTIONS:
!B
!B 	PICK CIRCLE: Pick the circle to be used as the starting circle of
!B 		the cone.
!B
!B 	ENDING RADIUS: Enter the ending radius of the cone.
!B
!B 	LENGTH: Enter the length of the cone to be constructed.
!B
!C NOTES:
!C 	The U contours of a cone are the circles and the V contours are the
!C 	lines.
!C

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

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

ActivateUndo
Units= CurrentUnits
IF Units= WsMetric THEN
        R2= 25
        Length= 100
ELSE
        R2= 1
        Length=5
END IF
Astart= 0
Angle= 180
Cone_angle=30.0

Cloop:!
Stat=SetInputFormat("n4","")

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

Stat=SetRadiusEquals(R2)
R2=InputRadius("ENDING RADIUS")
IF ExitScript(Destination$) THEN Leave
R2=ABS(R2)

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

C1=RadiusCircleCone(Pcircle,R2,Length)

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

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