
! script name: pksolids.d/pkcontourblock
! solids: construct block from a contour

!A
!A NAME:
!A
!A 	Contour Block
!A
!A DESCRIPTION:
!A
!A	This script makes a solid block from a synergy contour.
!A
!A~ image location - images/pkcontourblock.gif
!A
!B INSTRUCTIONS:
!B
!B	PICK CONTOUR: Pick the contour to be used.
!B
!B	HEIGHT ABOVE CONTOUR: Enter the height of the block above the contour.
!B 		Do not enter a negative number.
!B
!B	DEPTH BELOW CONTOUR: Enter the depth of the block below the contour.
!B 		A positive answer will go down.
!B
!C NOTES:
!C
!C	The contour must be contained in a plane.
!C
!# see also - htdocs/help.d/parasolids.htm

Stat=ChangeLabelStr("ScriptNameStatus","Function: contour block")

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

ActivateUndo

Stat= GLPlotOn
Pick_contour:!
Contour=PickGroupEnt("PICK CONTOUR ")
IF (ExitScript(Destination$)) THEN Leave

Stat=SetInputFormat("n4=","")
Stat=SetDepthEquals(Height1)
Height1=InputDepth("HEIGHT ABOVE CONTOUR")
IF ExitScript(Destination$) THEN Leave

Stat=SetInputFormat("n4=","")
Stat=SetDepthEquals(Depth1)
Depth1=InputDepth("DEPTH BELOW CONTOUR")
IF ExitScript(Destination$) THEN Leave

WPKClearErrorFlag
Pkbody=WPKContourBlock(Contour,Height1,Depth1)
Stat= DeleteEntity(Pc)

ActivateUndo
Stat= AdvanceUndoNumber("contour block")
Stat= AddItemToUndo(WsUBPKSessionMark)
WPKErrorCheck
GOTO Pick_contour

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