
! script name: points.d/ptsincont
! topic: delete all points inside contour and box

!A
!A NAME:
!A
!A 	Delete Points Inside a Contour
!A
!A DESCRIPTION:
!A
!A 	This script will delete all points inside a contour and inside
!A 	the specified box.
!A
!B INSTRUCTIONS:
!B
!B 	SELECT VIEW FOR SELECTION BOX: Pick the view to be used.
!B
!B 	PICK FIRST CORNER OF PICK ZONE: Pick a corner of the box to be used.
!B
!B 	PICK SECOND CORNER OF PICK ZONE: Pick the other corner of the box.
!B
!B 	PICK BOUNDING CONTOUR: Pick the contour to be used as the boundary
!B 		within the box.
!B

stat=ChangeLabelStr("ScriptNameStatus","Function: delete points inside a contour ")

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

DeActivateUndo
Group_loop:!
Group=CreateGroup("TEMPGROUP")

Vnum=PickView("SELECT VIEW FOR SELECTION BOX")
IF (ExitScript(Destination$)) THEN Leave

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


Contour=PickEntity("PICK BOUNDING CONTOUR")
IF (ExitScript(Destination$)) THEN Leave


Outgroup=GrpInsideCont(Contour,Group,WsInside)


Stat=UnLink(Outgroup)

Stat=DeleteGroup(Outgroup)
TransformCleanUp

Stat=DeleteEntity(Group)
GOTO Group_loop

Leave:!
Stat=DeleteEntity(Group)

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


