
! script name: vproperty.d/deletepropgrp
! var_topic: delete a group of info packets

!A
!A NAME:
!A
!A 	Delete Packet Group
!A
!A DESCRIPTION:
!A
!A 	This script deletes a group of info packets.
!A
!B INSTRUCTIONS:
!B
!B 	INFO PACKET GROUP TO BE DELETED: Select the info packet group that you 
!B 	want to delete.
!B

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

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

Var_object=CheckVarObject
IF ExitScript(Destination$) THEN Leave

Pick_group: !
DeActivateUndo
Stat=ListGrpNames("PACKET GROUPS","selected group","",WsGrpOfProperties)
IF Stat=1 THEN Leave
Stat=SetInputFormat("a99","")
Stat=GetValue("PACKET GROUP TO BE DELETED",Answer$)
IF (ExitScript(Destination$)) THEN Leave
Group=FindNamedGrp(Answer$)
IF NOT ValidGeometry(Group) THEN Pick_group
Stat=SetInputFormat("n4","")
LowerSelectBox

IF NOT ValidDependency(Group) THEN Pick_contour
Stat=EntityNameCheck(Group,Group_name$)

RecordFunctionOn
Stat=RecordDescr("PACKET GROUP: Delete ")
Stat=DeleteGroup(Group_name$,WsTrue)
RecordFunctionOff
CloseVarRecord

GOTO Pick_group


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

