
! script name: zplanes.d/odworkplane
! topic: define workplane working on the od of a mill turn part.

!A
!A NAME:
!A
!A 	Workplane: Od work plane
!A
!A DESCRIPTION:
!A
!A 	This script defines a workplane working on a od of a mill turn part.
!A
!B INSTRUCTIONS:
!B
!B 	CENTER POINT ABS X,Y,Z: Enter the X,Y,Z
!B 		coordinates for the center point.
!B 		NOTE: See XYZ INPUT OPTIONS.
!B
!B
!C NOTES:
!C
!C	This script is to be used for mill turn machine.
!C
!C
!C
!C
!# see also - points.d/xyzinput.hlp

stat=ChangeLabelStr("ScriptNameStatus","Function: workplane: od ")

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

Start:!
Stat=SetEqualsValue(Angle)
Stat=SetInputFormat("n4=","")

Stat=SetInputFormat("n4","")
Diameter=InputRadius("DIAMETER",WsDiaInput)
IF (ExitScript(Destination$)) THEN Leave

Angle= GetValue("ROTARY ANGLE  0, 90, 180, 270, ",Answer$)
IF (ExitScript(Destination$)) THEN Leave

StdWorkplane
stat= SetInputFormat("n4","")
Pc=XyzInput("CENTER POINT",WsXyzInput)
IF (ExitScript(Destination$)) THEN Leave

T1=OdWorkTransform(Pc,Diameter,Angle)

Stat=SetWorkplane(T1)
IF IsRulerOn THEN PlotAll

WplaneEnt= FindNamedVar("current work area",123456)
IF ValidGeometry(WplaneEnt) THEN Stat= DeleteEntity(WplaneEnt)

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