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

!A
!A NAME:
!A
!A      Box UnSet Exclude from Path
!A
!A DESCRIPTION:
!A
!A	This script turns on the object auto path functions for all
!A	records which create the entities picked in the box.
!A
!B INSTRUCTIONS:
!B
!B	SELECT VIEW FOR SELECTION BOX: Select the view for the pick box.
!B
!# see also - htdocs/help.d/vdminfo.htm

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

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

Highlight_color=4

DeActivateUndo
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,0)
			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
