
! script name: pksolids.d/pkcontourbody
! solids: construct a wire body from a contour

!A
!A NAME:
!A
!A 	Wire Body 
!A
!A DESCRIPTION:
!A
!A	This script makes a parasolids wire body from a contour.
!A
!A~ image location - images/pkwirebody.gif
!A
!B INSTRUCTIONS:
!B
!B	PICK CONTOUR: Pick the contour to be used.
!B 		The synergy contour is unchanged by this script.
!B
!C NOTES:
!C
!C	Not every synergy geometry entity has a direct parasolids 
!C	counterpart, also parasolids demands a connection accuracy
!C	which is greater that what is needed in synergy. For these 
!C	reasons some contour elements may be approximated or may be
!C	recalculated to satisfy parasolids requirements. Any approximation
!C	should be more accurate than any practical machining tolerances.
!C
!# see also - htdocs/help.d/parasolids.htm

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

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

ActivateUndo

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


WPKClearErrorFlag
Pkbody=WPKContourBody(Contour)
Stat= DeleteEntity(Pc)

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

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