
! script name: pkgroups.d/pkshowfacesbypen
! solids: show faces in a solid body by synergy pen

!A
!A NAME:
!A
!A	Show Faces By Color
!A
!A DESCRIPTION:
!A
!A	This script initiates a viewing mode where faces assigned the given
!A	colors will be displayed as shaded while the rest of the body
!A	is displayed in wireframe mode.
!A
!B INSTRUCTIONS:
!B
!B	COLORS VISIBLE:  Input a list of visible colors. Such as "1,2,3,10".
!B
!B NOTES:
!B
!B	The color list must be input, it cannot be picked.
!B
!B	Imported models which have RGB colors will be treated as if
!B	they have the closest synergy pen number attached.
!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 colors 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 pen ")


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

ActivateUndo


Start:!


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


WPKClearErrorFlag
Stat= GLPlotOn(0)
Stat= WPKShowFacesByPen(Colors$)


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