
! script name: delete.d/deletepltgrp
! topic: delete defined plot group

!A
!A NAME:
!A
!A 	Delete Plot Group
!A
!A DESCRIPTION:
!A
!A 	This script allows a plot group that has been defined to be deleted.
!A
!B INSTRUCTIONS:
!B
!B 	NAME OF PLOT GROUP TO BE DELETED: The selection box with the available
!B 		choices will appear for a selection to be made.
!B

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

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

DeActivateUndo
Start:!

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

Stat=SetInputFormat("a99","",Wsfalse)
Stat=GetValue("NAME OF PLOT GROUP TO BE DELETED   All",Name$)
IF (ExitScript(Destination$)) THEN Leave
IF Name$= "CANCEL" THEN Leave
IF Name$= "All" THEN
	Group= GrpOfUserProps(WsPlotGroup,WsPlotGroup)
	Stat= DeleteGroup(Group,WsTrue)
ELSE
	Pltgrp=FindUserData(Name$,WsPlotGroup)
	IF ((ValidGeometry(Pltgrp))) THEN
		Stat=DeleteEntity(Pltgrp)
	END IF
END IF

GOTO Start

Leave:!

LowerSelectBox

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