
! script name: delete.d/delworkarea
! topic: delete work plane from current list

!A
!A NAME:
!A
!A 	Delete Named Plane
!A
!A DESCRIPTION:
!A
!A 	This script will delete a named plane.
!A
!B INSTRUCTIONS:
!B
!B 	NAMED PLANE TO BE DELETED: The selection box with the NAMED PLANES
!B 		available will automatically appear for a selection
!B 		to be made.
!B

stat=ChangeLabelStr("ScriptNameStatus","Function: delete work zone ")

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


DeActivateUndo
Start:!
Stat=UserSelectBox("NAMED PLANES","selected plane",WsWorkArea,WsUserSelect)
IF Stat THEN Leave

Stat=SetInputFormat("a99","")
Stat=GetValue("NAMED PLANE TO BE DELETED",Answer$)
IF (ExitScript(Destination$)) THEN Leave
IF Answer$= "CANCEL" THEN Leave

Warea=FindUserData(Answer$,WsWorkArea)

IF ValidGeometry(Warea) THEN Stat=DeleteEntity(Warea)

GOTO Start

Leave:!
LowerSelectBox
stat= SetInputFormat("n4","")
IF (NOT LEN(Destination$)) THEN
	 LOAD "typecontrol"
ELSE
	 LOAD Destination$
END IF
END
