
! script name: vproperty.d/unlinkpropgrp
! var_topic: unlink a group of info packets

!A
!A NAME:
!A
!A 	Unlink Packet Group
!A
!A DESCRIPTION:
!A
!A 	This script unlinks a group of info packets.  Unlinking a group of info
!A 	packets means you are removing it from variational design. The data in
!A 	the packet will no longer change as the geometry changes. 
!A
!B INSTRUCTIONS:
!B
!B 	INFO PACKET GROUP TO BE UNLINKED: Select the info packet group to be
!B 	unlinked. 
!B

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

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

Var_object=CheckVarObject
IF ExitScript(Destination$) THEN Leave

DeActivateUndo
Pick_group: !
Stat=ListGrpNames("PACKET GROUPS","selected group","",WsGrpOfProperties)
IF Stat=1 THEN Leave
Stat=SetInputFormat("a99","")
Stat=GetValue("PACKET GROUP TO BE UNLINKED",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: Unlink ")
Stat=UnLink(Group_name$)
Stat=DeleteEntity(Group_name$)
RecordFunctionOff
CloseVarRecord

GOTO Pick_group


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

