
! script name: solids.d/twopointblock
! 3dtopic: construct plane faces for a rectangular block by picking two points

!A
!A NAME:
!A
!A 	Plane faces for rectangular block from two points.
!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 	POINT #1 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
!B 	POINT #2 ABS X,Y,Z: Enter the X,Y,Z coordinates of the upper
!B 		right-hand corner of the block.  NOTE: See XYZ INPUT OPTIONS.
!B
!C NOTES:
!C
!C
!# see also - points.d/xyzinput.hlp

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

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


ActivateUndo
Cloop:!

Stat=SetInputFormat("n4","")
Pt1=XyzInput("POINT #1 ",WsXyzInput)
IF ExitScript(Destination$) THEN Leave

Pt2=XyzInput("POINT #2 ",WsXyzInput)
IF ExitScript(Destination$) THEN Leave

C1=TwoPointBlock(Pt1,Pt2)

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

Stat=DeleteEntity(C1)
Stat=DeleteEntity(Pt1)
Stat=DeleteEntity(Pt2)

GOTO Cloop

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