
! script name: circles.d/reverseentdir
! topic: reverses an entity direction without creating a new entity.

!A
!A NAME:
!A
!A 	Reverse Direction
!A
!A DESCRIPTION:
!A
!A 	This script reverses an entities direction.
!A
!B INSTRUCTIONS:
!B
!B 	PICK ENTITY: Pick the entity to be oriented.
!B

stat=ChangeLabelStr("ScriptNameStatus","Function: reverse direction")

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

ActivateUndo
Start:Stat=SetInputFormat("n4","")
E1=PickEntity("PICK ENTITY")
IF ExitScript(Destination$) THEN Leave

ActivateUndo
Stat= AdvanceUndoNumber("reverse direction")
Stat= AddItemToUndo(WsUBModifyMode,E1)

Stat= RevEntDirection(E1)
GOTO Start

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

