
! script name: contours.d/nameboundary
! topic: name boundary

!A
!A NAME:
!A
!A 	Name Boundary
!A
!A DESCRIPTION:
!A
!A 	This script allows a boundary to be named.
!A
!B INSTRUCTIONS:
!B
!B 	PICK BOUNDARY TO BE NAMED: Pick the boundary that is to be named.
!B
!B 	BOUNDARY NAME: Enter the name of the boundary.
!B

stat=ChangeLabelStr("ScriptNameStatus","Function: boundary name ")

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

DeActivateUndo
Highlight_color=2
Stat= SetDefaults(WsSelectedEntPen,Highlight_color)

Ploop:!
Contour=PickGroupEnt("PICK BOUNDARY TO BE NAMED")
IF (ExitScript(Destination$)) THEN Leave
Boundary1= FindBoundary(Contour)
IF NOT ValidGeometry(Boundary1) THEN Ploop
Stat= SetSelectedFlag(Boundary1,WsTrue)
Stat= PlotEntity(Boundary1)


Stat=SetInputFormat("a99","")
Stat=GetValue("BOUNDARY NAME",Answer$)
IF (ExitScript(Destination$)) THEN Leave

Stat=NameEntity(Boundary1,Answer$)
Stat= SetSelectedFlag(Boundary1,WsFalse)
Stat= PlotEntity(Boundary1)

GOTO Ploop

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