
! script name: groups.d/rmdupsinbox
! topic: remove duplicate entities in a box

!A
!A NAME:
!A
!A 	Duplicate Entities
!A
!A DESCRIPTION:
!A
!A 	This script will remove duplicate entities inside a selected box.
!A
!B INSTRUCTIONS:
!B
!B 	PICK FIRST CORNER OF PICK ZONE: Pick
!B 		the first corner of the box.
!B
!B 	PICK SECOND CORNER OF PICK ZONE: Pick
!B 		the second corner of the box.
!B

stat=ChangeLabelStr("ScriptNameStatus","Function: remove dups ")

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

DeActivateUndo
Start: !

Stat= SetInputFormat("n4","")
Group=CreateGroup("TEMP")

Stat= PickBox(Group,Vnum,WsPickPen)
IF (ExitScript(Destination$)) THEN Leave

Stat= DelMatchingEnts(Group)
Stat= DeleteEntity(Group)

GOTO Start

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