
! script name: vcontrol.d/nopathswbox
! var_topic: set no path switch on elements in a box.

!A
!A NAME:
!A
!A 	Box Set Exclude from Path
!A
!A DESCRIPTION:
!A
!A	This script turns off the object auto path function for the
!A	record which creates this entity.
!A
!B INSTRUCTIONS:
!B
!B	SELECT VIEW FOR SELECTION BOX: Pick the view for the pick box.
!B
!C NOTES:
!C
!C 	Entities created by this record cannot be used in a contour.
!C 	Use this when an entity is not to be in one of the objects
!C 	contours.
!C
!# see also - htdocs/help.d/vdminfo.htm

Stat=ChangeLabelStr("ScriptNameStatus","Function: set no path switch in box")

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

DeActivateUndo
Highlight_color=2

Start:!
Group=CreateGroup("TEMPGROUP")


Vnum= LastPickView
Stat=PickBox(Group,Vnum,Highlight_color)
IF ExitScript(Destination$) THEN Leave
IF NOT ValidGeometry(Group) THEN leave

Num_elements=GroupCount(Group)
FOR I=1 TO Num_elements
	E1=GroupElement(Group,I)
	IF ValidGeometry(E1) THEN 
		Var_record=VarRecordParent(E1)
		IF ValidGeometry(Var_record) THEN 
			Stat=SetNoPathFlag(Var_record,1)
			Stat= Highlight(Var_record,Highlight_color,0)
		END IF
	END IF
NEXT I
Stat=DeleteEntity(Group)

GOTO Start

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