
! script name: pkgroups.d/pkshowbySEprop
! solids: show faces by solid edge property

!A
!A NAME:
!A
!A	Show Faces By Solid Edge Property
!A
!A DESCRIPTION:
!A
!A      This script establishes a viewing mode where faces matching
!A      a solid edge property are displayed as rendered with the rest of the
!A      body is displayed in wireframe mode.
!A
!B NOTE:
!B
!B      Solid edge user properties are attached by Solid Edge. The
!B      solid model must have been imported from Solid Edge.
!B
!# see also - htdocs/help.d/parasolids.htm

stat=ChangeLabelStr("ScriptNameStatus","Function: show faces by solid edge property ")

DIM Destination$[256]
DIM Answer$[256]
DIM Name$[256]
DIM Name1$[256]
DIM Namelist$[32000]
DIM Namelist1$[32000]
DIM Datalist$[32000]
DIM D_label$[512]
DIM Choice$[512]
DIM Mask$[32]

ActivateUndo


Start:!
Pkbody= WPKCurrentBody
IF NOT WPKIsEntity(Pkbody) THEN
	Stat=SetInputFormat("n4","")
	E1=WPKPickEntity("PICK BODY")
	IF (ExitScript(Destination$)) THEN Leave
	IF NOT WPKIsEntity(E1) THEN Start
	Pkbody= WPKParentBody(E1)
END IF

Datalist$=","
Select_prop:!
Namelist1$= WPKSEPropNamesStr(",")
Stat= AlphabeticalOrder(Namelist1$,",",WsAscending,Namelist$)

D_label$="SE USER PROPERTIES"
Choice$="PROPERTY SELECTED"
Mask$="*"
Stat=GeneralListBox(D_label$,Choice$,Namelist$)

Pick_name:stat= SetInputFormat("a99","")
Stat=SetInputFormat("a99","")
Stat=GetValue("SELECT NAME",Answer$)
IF (ExitScript(Destination$)) THEN Leave
IF Answer$= "CANCEL" THEN Leave
Name$= Answer$
IF POS(","&Datalist$&",",","&Name$&",") THEN Select_prop
Datalist$= Datalist$&","&Name$

WPKClearErrorFlag
Stat= GLPlotOn(0)
Pkgroup= WPKShowBySEList(Pkbody,Datalist$)

GOTO Select_prop

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