
! script name: pksolids.d/pkoffsetcontour
! solids: construct an offset wire body from a contour

!A
!A NAME:
!A
!A 	Offset Contour Wire Body: 
!A
!A DESCRIPTION:
!A
!A	This script makes a parasolids offset wire body from a contour.
!A
!A
!B INSTRUCTIONS:
!B
!B	PICK CONTOUR: Pick the contour to be used. The synergy contour is
!B			unchanged by this script.
!B
!# see also - htdocs/help.d/parasolids.htm

Stat=ChangeLabelStr("ScriptNameStatus","Function: offset contour wire body")

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

ActivateUndo

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

Stat=SetInputFormat("n4=","")
Stat=SetEqualsValue(Offset)
Offset=GetValue("OFFSET",Answer$)
IF ExitScript(Destination$) THEN Leave

WPKClearErrorFlag
PlotOff
Pkbody=WPKContourBody(Contour)
PlotOn
Pkbody1= WPKOffsetWireBody(Pkbody,Offset)
Stat= WPKDeleteBody(Pkbody)

ActivateUndo
Stat= AdvanceUndoNumber("offset contour wire body")
Stat= AddItemToUndo(WsUBPKSessionMark)
WPKErrorCheck
GOTO Pick_contour

Leave:!
Stat=SetInputFormat("n4","")
PlotOn
IF NOT LEN(Destination$) THEN
	LOAD "typecontrol"
ELSE
	LOAD Destination$
END IF
END
