
! script name: colors.d/colorentity
! topic: assign color to single element

!A
!A NAME:
!A
!A 	Color Entity
!A
!A DESCRIPTION:
!A
!A 	This script allows a single element to be colored.
!A
!B INSTRUCTIONS:
!B
!B 	PICK ELEMENT TO BE COLORED: Pick the element 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 entity ")

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

ActivateUndo
Pen_color= CurrentColor
IF ARGC<2 THEN RaiseColorBox

Ploop:!

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

ActivateUndo
Stat= AdvanceUndoNumber("color entity")
Stat= AddItemToUndo(WsUBModifyMode,E1)

Stat=SetColor(E1)
IF WPKIsEntity(E1) THEN 
Stat= AddItemToUndo(WsUBPKSessionMark)
END IF

GOTO Ploop

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