
! script name: pkgroups.d/pkshowfacesbylayer
! solids: show faces in a solid body by layer

!A
!A NAME:
!A
!A	Show Faces By Layer
!A
!A DESCRIPTION:
!A
!A	This script initiates a viewing mode where faces on the given
!A	layers will be displayed as shaded while the rest of the body
!A	is displayed in wireframe mode.
!A
!B INSTRUCTIONS:
!B
!B	LAYERS VISIBLE:  Input a list of visible layers. Such as "1,2,3,10".
!B
!B NOTES:
!B
!B	The layer list must be input, it cannot be picked.
!B
!B	This is a viewing mode only not a working mode. 
!B	When it is established the visible faces are shaded.
!B	If while this mode is in effect, new faces are
!B	created on the layers selected they are not automatically made
!B	visible. The mode must be reestablished to incorporate any changes.
!B
!# see also - htdocs/help.d/parasolids.htm

OPTION BASE 1

stat=ChangeLabelStr("ScriptNameStatus","Function: show faces by layer ")


DIM Destination$[256]
DIM Answer$[256]
DIM Layers$[512]

ActivateUndo


Start:!


Input_layers:!
Stat=SetInputFormat("a99","",WsFalse)
Stat=GetValue("LAYERS VISIBLE ",Layers$)
IF (ExitScript(Destination$)) THEN Leave
IF LEN(Layers$) THEN 
	Layers$= ","&Layers$&","
ELSE
	GOTO Input_layers
END IF


WPKClearErrorFlag
Stat= GLPlotOn(0)
Stat= WPKShowByLayer(Layers$)


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