
! script name: zplanes.d/xzplane
! topic: define XZ workplane

!A
!A NAME:
!A
!A 	XZ Plane
!A
!A DESCRIPTION:
!A
!A 	This script allows a workplane to be defined for the XZ plane.
!A
!B INSTRUCTIONS:
!B
!B 	INPUT ABS X,Y,Z: Enter the X,Y,Z coordinates for the reference point
!B 		of the XZ plane being defined.  NOTE: See XYZ INPUT OPTIONS.
!B
!# see also - points.d/xyzinput.hlp

stat=ChangeLabelStr("ScriptNameStatus","Function: xz plane ")

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

StdWorkplane
Stat=SetInputFormat("n4","")

Pt=XyzInput("INPUT",WsXyzInput)
IF (ExitScript(Destination$)) THEN Leave

T1=AngleTransform(Pt,90,0,0)

Stat=SetWorkplane(T1)
IF IsRulerOn THEN PlotAll

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

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