
! script name: pksolids.d/pkannulus
! solids: construct a annular ring sheet body.

!A
!A NAME:
!A
!A 	Annulus
!A
!A DESCRIPTION:
!A
!A 	This script will construct a annular ring sheet body. An annulus
!A	is the area between two concentric circles. 
!A
!B INSTRUCTIONS:
!B
!B	INNER RADIUS: Enter the inner radius of the ring.
!B
!B	OUTER RADIUS: Enter the outer radius of the ring.
!B
!B	CENTER LOCATION POINT: Input the location of the center of the ring.
!B
!B	AXIS DIRECTION POINT: Input a point specifing the direction of
!B 		the ring axis.
!B
!# see also - htdocs/help.d/parasolids.htm

Stat=ChangeLabelStr("ScriptNameStatus","Function: annular ring")

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


ActivateUndo
Units= CurrentUnits
IF Units= WsMetric THEN
        R2= 25
        R1= 12.5
ELSE
        R2= 1
        R1= 0.5
END IF

Stat= GLPlotOn
Cloop:!
Stat=SetInputFormat("n4=","")
Stat=SetRadiusEquals(R1)
R1=InputRadius("INNER RADIUS")
IF ExitScript(Destination$) THEN Leave

Stat=SetInputFormat("n4=","")
Stat=SetRadiusEquals(R2)
R2=InputRadius("OUTER RADIUS")
IF ExitScript(Destination$) THEN Leave

Stat=SetInputFormat("n4","")
Ps=XyzInput("CENTER LOCATION POINT ",WsXyzInput)
IF ExitScript(Destination$) THEN Leave
Stat= SetLastPoint(Ps)

Stat=SetInputFormat("n4","")
Pe=XyzInput("AXIS DIRECTION POINT ",WsXyzInput)
IF ExitScript(Destination$) THEN Leave

WPKClearErrorFlag
C1=WPKAnnulus(Ps,Pe,R1,R2)

Stat= DeleteEntity(Ps)
Stat= DeleteEntity(Pe)

ActivateUndo
Stat= AdvanceUndoNumber("annular ring sheet body")
Stat= AddItemToUndo(WsUBPKSessionMark)
WPKErrorCheck

GOTO Cloop

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