
! script name: colors.d/colordims
! topic: assign color to a composite dimension

!A
!A NAME:
!A
!A 	Color Dimension
!A
!A DESCRIPTION:
!A
!A 	This script allows a composite dimension to be colored.
!A
!B INSTRUCTIONS:
!B
!B 	PICK DIMENSION TO BE COLORED: Pick the dimension that will be colored.
!B
!B OPTIONS:
!B
!B 	The color selection box will automatically appear to allow a color
!B 	to be selected.
!B

stat=ChangeLabelStr("ScriptNameStatus","Function: color dimension ")

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

ActivateUndo
Pen_color= CurrentColor
RaiseColorBox

Ploop:!

E1=PickEntity("PICK DIMENSION TO BE COLORED")
IF (ExitScript(Destination$)) THEN Leave

IF NOT ValidGeometry(E1) THEN Ploop
E2= ParentDimEnt(E1)
IF NOT ValidGeometry(E2) THEN Ploop

ActivateUndo
Stat= AdvanceUndoNumber("color dimension")
Stat= AddDimToUndo(WsUBModifyMode,E2)

Stat=ColorDimension(E2)

GOTO Ploop

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