
! script name: solids.d/blockplanes
! 3dtopic: construct plane faces for a rectangular block

!A
!A NAME:
!A
!A 	Plane faces for rectangular block.
!A
!A DESCRIPTION:
!A
!A 	This script will construct the six faces of a rectangular block.
!A 	The pass parameter will determine where the reference point is
!A 	located on the block.
!A
!B INSTRUCTIONS:
!B
!B 	X LENGTH: Enter the length of the block measured along the X axis.
!B
!B 	Y LENGTH: Enter the length of the block measured along the Y axis.
!B
!B 	Z LENGTH: Enter the length of the block measured along the Z axis.
!B
!B 	REFERENCE POINT ABS X,Y,Z: Enter the X,Y,Z coordinates of the lower
!B 		left-hand corner of the block.  NOTE: See XYZ INPUT OPTIONS.
!B
!C NOTES:
!C
!C 	This script has 10 pass parameters available.  They are:
!C
!C 		 1 - BottomLowerLeft
!C 		 2 - TopLowerLeft
!C 		 3 - BottomLowerRight
!C 		 4 - TopLowerRight
!D 		 5 - BottomUpperRight
!C 		 6 - TopUpperRight
!C 		 7 - BottomUpperLeft
!C 		 8 - TopUpperLeft
!C 		 9 - BottomCenter
!C 		10 - TopCenter
!C
!# see also - points.d/xyzinput.hlp

Stat=ChangeLabelStr("ScriptNameStatus","Function: blockplanes ")

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

Zero_type=10

Xlength=5
Ylength=5
Zlength=1

ActivateUndo
Cloop:!

Stat=SetInputFormat("n4=","")
Stat=SetEqualsValue(Xlength)
XLength=GetValue("X LENGTH",Answer$)
IF ExitScript(Destination$) THEN Leave

Stat=SetInputFormat("n4=","")
Stat=SetEqualsValue(Ylength)
YLength=GetValue("Y LENGTH",Answer$)
IF ExitScript(Destination$) THEN Leave

Stat=SetInputFormat("n4=","")
Stat=SetEqualsValue(Zlength)
ZLength=GetValue("Z LENGTH",Answer$)
IF ExitScript(Destination$) THEN Leave

Stat=SetInputFormat("n4","")
Pt=XyzInput("REFERENCE POINT ",WsXyzInput)
IF ExitScript(Destination$) THEN Leave

C1=RectangularBlock(Zero_type,Pt,Xlength,Ylength,Zlength)

ActivateUndo
Stat= AdvanceUndoNumber("block planes")
Stat= AddGroupToUndo(WsUBCreateMode,C1,0,WsFalse)


Stat=DeleteEntity(C1)
Stat=DeleteEntity(Pt)

GOTO Cloop

Leave:!
Stat=DeleteEntity(Pt)

IF NOT LEN(Destination$) THEN
	LOAD "typecontrol"
ELSE
	LOAD Destination$
END IF
END
