
! script name: delete.d/unlinkall
! topic: unlink and delete all group entities

!A
!A NAME:
!A
!A 	Unlink and Delete All Group Entities
!A
!A DESCRIPTION:
!A
!A 	This script will unlink and delete all group, boundary and fill  
!A 	entities but leave other entities alone.
!A
!B INSTRUCTIONS:
!B
!B 	DO YOU WANT TO UNLINK ALL GROUPS? Yes or No:
!B
!B 		Y - Enter Y to unlink all groups.
!B 		N - Enter N to leave the script.
!B
!C NOTE:
!C
!C 	This script may be useful for iges files to remove the
!C 	hundreds of groups that may sometimes be created.
!C

stat=ChangeLabelStr("ScriptNameStatus","Function: unlink all ")

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

Stat=SetInputFormat("a1=",",Y,N,")
Stat=SetEqualsValue(0,"Y")
Stat=GetValue("DO YOU WANT TO UNLINK ALL GROUPS?  Yes or No",Answer$)
IF (ExitScript(Destination$)) THEN Leave

IF Answer$="Y" THEN
	DeActivateUndo
	DeleteAllGroups
END IF

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