
! script name: parasolids.d/pkcolorbodyedges
! solids: assign color to the edges in a  solid body

!A
!A NAME:
!A
!A 	Color Body Edges
!A
!A DESCRIPTION:
!A
!A 	This script colors the edges in a solid body.
!A
!B INSTRUCTIONS:
!B
!B 	PICK BODY TO BE COLORED: Pick the body that will be colored.
!B
!# see also - htdocs/help.d/parasolids.htm


stat=ChangeLabelStr("ScriptNameStatus","Function: color body edges")

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

ActivateUndo
Pen_color= CurrentColor
IF ARGC<2 THEN RaiseColorBox

Stat= GLPlotOn
Pick_loop:!

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

Pkbody= WPKParentBody(E1)
Pen_color= CurrentColor
Stat= WPKColorEntity(Pkbody,Pen_color,0,WsTrue)

ActivateUndo
Stat= AdvanceUndoNumber("color body edges")
Stat= AddItemToUndo(WsUBPKSessionMark)

GOTO Pick_loop

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