
! script name: plot.d/plotsubgroup

!A
!A NAME:
!A
!A 	Plot By Named Sub-group
!A
!A DESCRIPTION:
!A
!A 	This script allows geometry associated with a particular
!A 	named sub group to be plotted.
!A
!B INSTRUCTIONS:
!B
!B 	INPUT SUB-GROUP NAME: The SUB-GROUPS selection box will appear
!B		at this time.  Select the sub-group associated with the
!B		geometry to be plotted from the select box.
!B

stat=ChangeLabelStr("ScriptNameStatus","Function: plot by named workplane ")

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

Start:!
No_box=UserSelectBox("SUB-GROUPS","selected sub-group",WsSubGroups,WsUserSelect)
IF No_box THEN Leave

Stat=SetInputFormat("a99","")
E1=PickEntity("INPUT SUB-GROUP NAME",Answer$)
IF ExitScript(Destination$) OR Answer$= "CANCEL" THEN Leave

IF ValidGeometry(E1) THEN
        Sub_group=GetAssocEnt(E1,WsSubGroups)
ELSE
	Sub_group=FindUserData(Answer$,WsSubGroups)
END IF
IF NOT ValidGeometry(Sub_group) THEN Start
ClearAll
Stat=PlotAssocEnt(Sub_group,WsSubGroups)
GOTO Start

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