
! script name: pksurfaces.d/pkbsurf
! solids: construct sheet bodies for synergy nurb surface

!A
!A NAME:
!A
!A 	Convert Surface to Sheet Body
!A
!A DESCRIPTION:
!A
!A	This script will make a sheet body from a synergy surfaces.
!A
!B INSTRUCTIONS:
!B
!B	PICK SURFACE: Pick the synergy surface.	
!B
!C NOTES:
!C
!C	Can be used to convert existing surfaces into a parasolids
!C	sheet body. 
!C
!# see also - htdocs/help.d/parasolids.htm

Stat=ChangeLabelStr("ScriptNameStatus","Function: convert surf to sheet ")

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

ActivateUndo

Stat= GLPlotOn
Pick_surface:!

E1=PickEntity("PICK SURFACE")
IF (ExitScript(Destination$)) THEN Leave
IF NOT ValidGeometry(E1) THEN Pick_surface

WPKClearErrorFlag
S1=WPKMakeBsurf(E1)

ActivateUndo
Stat= AdvanceUndoNumber("nurb surf sheet body")
Stat= AddItemToUndo(WsUBPKSessionMark)
WPKErrorCheck
GOTO Pick_surface

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