
! script name: linetypes.d/ltypecontour
! topic: assign line type to a contour

!A
!A NAME:
!A
!A 	Line Type a Contour
!A
!A DESCRIPTION:
!A
!A 	This script allows a contour to have a line type associated with it.
!A
!B INSTRUCTIONS:
!B
!B 	SELECT LINE TYPE: The LINE TYPES options selection box will
!B 		automatically appear to allow the selection of a line type.
!B
!B 	PICK CONTOUR TO BE ASSIGNED LINE TYPE # : Pick the contour to be
!B 		assigned to the selected line type.  This question will
!B 		repeat until another option is selected.
!B

stat=ChangeLabelStr("ScriptNameStatus","Function: line type a contour ")

DIM Destination$[256]
DIM Answer$[256]
DIM Namelist$[1000]
DIM Title$[256]
DIM Label$[256]

ActivateUndo
Start:!
IF OSystemId=2 THEN
        Line_type=CurrentLT
ELSE
Title$="LINE TYPES"
Label$="LINE TYPE SELECTED"
Namelist$=          "1  ________________________,"
Namelist$=Namelist$&"2  . . . . . . . . . . . . ,"
Namelist$=Namelist$&"3  .   .   .   .   .   .  .,"
Namelist$=Namelist$&"4  ........................,"
Namelist$=Namelist$&"5  __ __ __ __ __ __ __ __ ,"
Namelist$=Namelist$&"6  __ _  __ _  __ _ __ _ __,"
Namelist$=Namelist$&"7  __ .  __ .  __ . __ . __,"
Namelist$=Namelist$&"8  __ .. __ .. __ .. __ .. ,"
Namelist$=Namelist$&"9  WIDE ___________________,"
Namelist$=Namelist$&"10 XWIDE __________________,"
Namelist$=Namelist$&"11 XXWIDE _________________,"
Namelist$=Namelist$&"12 WIDE __ __ __ __ __ __ _,"
Namelist$=Namelist$&"13 ____  _____ _____ _____ ,"
Namelist$=Namelist$&"14 ____ . _____ . _____ . _,"
Namelist$=Namelist$&"15 ____ .. _____ .. _____ .,"
Namelist$=Namelist$&"16 ___ ___ _ _ ___ ___ _ _ ,"
Namelist$=Namelist$&"17 ___ ___ .. ___ ___ ..   ,"
Namelist$=Namelist$&"18 ____ ____ _ _ ____ ____ _ _,"
Namelist$=Namelist$&"19 _____ ... _____ ... ,"

Stat=GeneralListBox(Title$,Label$,Namelist$)
Stat=SetInputFormat("a99","")
Stat=GetValue("SELECT LINE TYPE",Answer$)
IF ExitScript(Destination$) THEN Leave
IF Answer$="CANCEL" THEN Leave

ON ERROR GOTO Start

Ltype= VAL(Answer$)
IF Ltype<1 OR Ltype>19 THEN Start
LowerSelectBox
END IF

Ploop:!

IF OSystemId=2 THEN
E1=PickEntity("PICK CONTOUR TO BE ASSIGNED LINE TYPE ",Answer$)
ELSE
E1=PickEntity("PICK CONTOUR TO BE ASSIGNED LINE TYPE "&VAL$(LType),Answer$)
END IF
IF (ExitScript(Destination$)) THEN Leave
IF NOT ValidGeometry(E1) THEN
	IF Answer$= "CANCEL" THEN Leave
	IF VAL(Answer$)<1 OR VAL(Answer$)> 19 THEN Ploop
	Ltype= VAL(Answer$)
ELSE

	Group= ParentGroup(E1)
	ActivateUndo
	Stat= AdvanceUndoNumber("linetype contour")
	Stat= AddGroupToUndo(WsUBModifyMode,Group,0,WsFalse)

	Stat=LTypeContour(E1)
END IF

GOTO Ploop

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