
! script name: colors.d/colorsimrev
! topic: assign color similar revolutions 

!A
!A NAME:
!A
!A 	Color in Similar Revolutions
!A
!A DESCRIPTION:
!A
!A	This script colors all revolutions in a box which have a similar
!A	radius and angular extent to the given revolution.
!A
!B INSTRUCTIONS:
!B
!B      PICK REVOLUTION: Pick the revolution to determine the axes.
!B
!B      SELECT VIEW FOR SELECTION BOX: Pick the view that elements will be
!B              colored in.
!B
!B      PICK FIRST CORNER OF PICK ZONE: Pick a corner of the box.
!B
!B      PICK SECOND CORNER OF PICK ZONE: Pick the other corner of the view box.
!B

stat=ChangeLabelStr("ScriptNameStatus","Function: color similar revolutions ")

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

ActivateUndo
Pen_color= CurrentColor
Start:!
RaiseColorBox

E1=PickEntity("PICK REVOLUTION")
IF (ExitScript(Destination$)) THEN Leave
Etype= EntityType(E1)
IF Etype<> WsRevolutionEnt THEN Start

Group_loop:!
Group=CreateGroup("TEMPGROUP")

Vnum= LastPickView
Stat=PickBox(Group,Vnum,0)
IF (ExitScript(Destination$)) THEN Leave

Group1= SimilarRevGrp(Group,E1)

ActivateUndo
Stat= AdvanceUndoNumber("color similar revs")
Stat= AddGroupToUndo(WsUBModifyMode,Group1,0,WsFalse)

Stat=SetColor(Group1)
Stat=PlotEntity(Group1)
Stat=DeleteEntity(Group)
Stat=DeleteEntity(Group1)
GOTO Start

Leave:!
LowerColorBox
Stat=DeleteEntity(Group)
Stat=DeleteEntity(Group1)
IF (NOT LEN(Destination$)) THEN
	 LOAD "typecontrol"
ELSE
	 LOAD Destination$
END IF
END


