
! script name: parasolids.d/boundaryedges
! solids: explodes the bounding edges of a sheet body

!A
!A NAME:
!A
!A 	Convert Bounding Edges
!A
!A DESCRIPTION:
!A
!A 	This script explodes the bounding edges of a sheet body. The boundary
!A 	edges are those edges which have only one face abutting.
!A
!A~ image location - images/pkboundingedges.gif
!A
!B INSTRUCTIONS:
!B
!B 	PICK SHEET BODY: Pick a sheet body.
!B
!# see also - htdocs/help.d/parasolids.htm

stat=ChangeLabelStr("ScriptNameStatus","Function: explode bounding edges ")

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

ActivateUndo

Pick_loop:!

E1=WPKPickEntity("PICK SHEET BODY")
IF (ExitScript(Destination$)) THEN Leave
IF NOT WPKIsEntity(E1) THEN Pick_loop

Body= WPKParentBody(E1)
Body_type= WPKBodyType(Body)
IF Body_type<> WsPKSheetBody THEN Pick_loop

Group= WPKLaminarEdges(E1)

Stat= PlotEntity(group)

ActivateUndo
Stat= AdvanceUndoNumber("explode bounding edges")
Stat= AddGroupToUndo(WsUBCreateMode,Group,0,WsTrue)
Stat= DeleteEntity(group)


GOTO Pick_loop

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