
! script name: colors.d/colorparalines
! topic: assign color to all lines parallel to a given line

!A
!A NAME:
!A
!A 	Color Parallel Lines
!A
!A DESCRIPTION:
!A
!A	This script colors all lines parallel to a given line. Here
!A	parallel is used to mean in a 3D sense. That is the vector
!A	directions specified by the lines are the same.
!A
!B INSTRUCTIONS:
!B
!B	PICK LINE: Pick the live to determine the direction.
!B

stat=ChangeLabelStr("ScriptNameStatus","Function: color parallel lines ")

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

ActivateUndo
Pen_color= CurrentColor
RaiseColorBox

Pick_line:!

E1=PickSpecificEnt("PICK LINE ",WsPickLines)
IF (ExitScript(Destination$)) THEN Leave

Pen_color= CurrentColor
G1= GrpParallelLines(E1)

ActivateUndo
Stat= AdvanceUndoNumber("color parallel lines")
Stat= AddGroupToUndo(WsUBModifyMode,G1,0,WsFalse)

Stat=SetColor(G1)
Stat= DeleteEntity(G1)

GOTO Pick_line

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