
! script name: rims.d/inverttypes
! topic: invert types in contour

!A
!A NAME:
!A
!A 	Invert Types
!A
!A DESCRIPTION:
!A
!A 	This script allows types in a contour to be inverted as the contour
!A 	is described.  The types inverted 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
!B 		inverted.
!B
!B 	PICK ENDING TYPE: Pick an element of the ending type to be inverted.
!B
!B 	ANGLE OF INVERSION LINE: Enter the angle of the line that the types
!B 		should be inverted about.
!B

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

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

stat= SetInputFormat("n4","")

DeActivateUndo
Ploop:!
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("ANGLE OF INVERSION LINE")
IF (ExitScript(Destination$)) THEN Leave

T1=InvertTypes(Start_type,End_type,Last_type,Angle)

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