
! script name: rims.d/rotatetypes
! topic: rotate types in contour

!A
!A NAME:
!A
!A 	Rotate Types
!A
!A DESCRIPTION:
!A
!A 	This script allows types in a contour to be rotated as the contour
!A 	is described.  The types rotated are automatically attached to the
!A 	last type defined.
!A
!B INSTRUCTIONS:
!B
!B 	PICK STARTING TYPE: Pick an element of the starting type to be rotated.
!B
!B 	PICK ENDING TYPE: Pick an element of the ending type to be rotated.
!B
!B 	ROTATION ANGLE: Enter the angular rotation of the types being rotated
!B 		in degrees.
!B
!B 	NUMBER OF TIMES ROTATE: Enter the number of times the rotate sequence
!B 		should be repeated.
!B

stat=ChangeLabelStr("ScriptNameStatus","Function: rotate types ")

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


DeActivateUndo
Ploop:!
stat= SetInputFormat("n4","")

Last_type=FindLastType

IF NOT ValidGeometry(Last_type) THEN Leave

Start_type=PickTypeEnt("PICK STARTING TYPE")
IF (ExitScript(Destination$)) THEN Leave

End_type=PickTypeEnt("PICK ENDING TYPE")
IF (ExitScript(Destination$)) THEN Leave

Angle=InputAngle("ROTATION ANGLE")
IF (ExitScript(Destination$)) THEN Leave

Stat=SetInputFormat("n0","")
Ntimes=GetValue("NUMBER OF TIMES ROTATE",Answer$)
IF (ExitScript(Destination$)) THEN Leave

T1=RotateTypes(Start_type,End_type,Last_type,Angle,Ntimes)

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