
! script name: plot.d/plotgroup
! topic: plot group

!A
!A NAME:
!A
!A 	Plot Group
!A
!A DESCRIPTION:
!A
!A 	This script allows a group that was specifically made as a plot
!A 	group to be plotted.  The group is associated with specific layers
!A 	and colors.
!A
!B INSTRUCTIONS:
!B
!B 	INPUT PLOT GROUP NAME:  The PLOT GROUPS selection box will appear
!B 		at this time.  Select the name of the group to be plotted.
!B

stat=ChangeLabelStr("ScriptNameStatus","Function: plot group ")

DIM Destination$[256]
DIM Answer$[256]
DIM Name$[256]
DIM Layers$[256]
DIM Colors$[256]
DIM Components$[256]
DIM Assemblys$[256]

Use_components=0
Use_assemblys=0
Start:!

Stat=UserSelectBox("PLOT GROUPS","selected group",WsPlotGroup,WsUserSelect)
IF Stat=1 THEN Leave

Stat=SetInputFormat("a99","")
Stat=GetValue("INPUT PLOT GROUP NAME",Name$)
IF (ExitScript(Destination$)) THEN Leave
IF Name$="CANCEL" THEN Leave

Pltgrp=FindUserData(Name$,WsPlotGroup)

Stat=GetUserString(Pltgrp,"LAYERS:",Layers$)
IF POS(Layers$,"A") OR POS(Layers$,"a") THEN
	Stat=SetPlotLayers("")
ELSE
	Stat=SetPlotLayers(","&Layers$&",")
END IF

Stat=GetUserString(Pltgrp,"COLORS:",Colors$)
IF POS(Colors$,"A") OR POS(Colors$,"a") THEN
	Stat=SetPlotColors("")
ELSE
	Stat=SetPlotColors(","&Colors$&",")
END IF

IF Use_Assemblys THEN
	Stat=GetUserString(Pltgrp,"ASSEMBLIES:",Assemblys$)
	IF POS(Assemblys$,"A") OR POS(Assemblys$,"a") THEN
		Stat=SetPlotAssemblys("")
	ELSE
		Stat=SetPlotAssemblys(","&Assemblys$&",")
	END IF
END IF

IF Use_Components THEN
	Stat=GetUserString(Pltgrp,"COMPONENTS:",Components$)
	IF POS(Components$,"A") OR POS(Components$,"a") THEN
		Stat=SetPlotComponents("")
	ELSE
		Stat=SetPlotComponents(","&Components$&",")
	END IF
END IF

UpdatePlot

Leave:!

LowerSelectBox

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