
! script name: zplanes.d/faceworkplane
! topic: define workplane working on a face of a mill turn.

!A
!A NAME:
!A
!A 	Workplane: Face work plane
!A
!A DESCRIPTION:
!A
!A 	This script defines a workplane working on a face of a mill turn.
!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: face ")

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

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

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

T1=FaceWorkTransform(Pc)

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
