
! script name: parasolids.d/pktransparentent
! solids: make a face transparent

!A
!A NAME:
!A
!A 	Transparent Face
!A
!A DESCRIPTION:
!A
!A 	This script makes a single face transparent.
!A
!B INSTRUCTIONS:
!B
!B 	TRANSLUCENCY: A value of zero and the face will
!B 		be opaque.  A value of 1.0 and it will be transparent.
!B
!B 	PICK FACE: Pick the face that will be transparent.
!B
!B NOTE:
!B
!B 	The transparency is a graphical effect only. The result may
!B 	vary with different graphics cards. It may not necessarily
!B 	be what is expected.
!B
!# see also - htdocs/help.d/parasolids.htm


stat=ChangeLabelStr("ScriptNameStatus","Function: make a face transparent ")

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

ActivateUndo

Stat= GLPlotOn

Ask_translucency:!
Stat=SetInputFormat("n4=","")
Stat=SetEqualsValue(.7)
Translucency=GetValue("TRANSLUCENCY: ( 0.0 opaque - 1.0 transparent )")
IF ExitScript(Destination$) THEN Leave

Face_loop:!

E1=WPKPickEntity("PICK FACE",WsPKPickFace)
IF (ExitScript(Destination$)) THEN Leave
IF NOT WPKIsEntity(E1) THEN Face_loop

Stat= WPKTranslucency(E1,Translucency)
Stat= WPKUpdateBody(E1)

ActivateUndo
Stat= AdvanceUndoNumber("face transparent")
Stat= AddItemToUndo(WsUBPKSessionMark)

GOTO Face_loop

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