
! script name: circles.d/centerlocus
! topic: construct circle with known radius and center located on entity

!A
!A NAME:
!A
!A	 Rad: Center Locus: Tangent
!A
!A DESCRIPTION:
!A
!A 	This script constructs a circle with known radius with its center
!A 	located along a known entity, tangent to a known element.
!A
!A~ image location - images/centerlocus.gif
!A
!B INSTRUCTIONS:
!B
!B 	CIRCLE RADIUS: Enter radius of circle to be constructed.
!B
!B 	PICK LOCUS OF CIRCLE CENTER: Pick the entity that the center
!B 		of the circle to be constructed is located on.
!B 
!B 	PICK TANGENT ELEMENT: Pick the element that will be tangent
!B 		to the circle constructed.
!B

stat=ChangeLabelStr("ScriptNameStatus","Function: rad: center locus: tangent ")

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

DEG

ActivateUndo
stat= SetInputFormat("n4","")
Circle_loop:!
stat= SetInputFormat("n4=","")
Radius=InputRadius("CIRCLE RADIUS")
IF (ExitScript(Destination$)) THEN Leave

E1=SelectCenterLocus(Radius)
IF (ExitScript(Destination$)) THEN Leave

ActivateUndo
Stat= AdvanceUndoNumber("circle")
Stat= AddItemToUndo(WsUBCreateMode,E1)

GOTO Circle_loop

Leave:!
stat= SetInputFormat("n4","")
IF (NOT LEN(Destination$)) THEN
	 LOAD "typecontrol"
ELSE
	 LOAD Destination$
END IF
END
