
! script name: pksurfaces.d/pkruled
! solids: construct loft from synergy ruled surface

!A
!A NAME:
!A
!A 	Make Ruled
!A
!A DESCRIPTION:
!A
!A	THis script makes a sheet body from a synergy ruled surface.
!A
!B INSTRUCTIONS:
!B
!B	PICK RULED SURFACE: Pick the ruled surface.
!B
!C NOTES:
!C
!C	Can be used to make a sheet body from an existing ruled surface.
!C	Trim curves are not currently supported.
!C
!# see also - htdocs/help.d/parasolids.htm

Stat=ChangeLabelStr("ScriptNameStatus","Function: make ruled ")

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

ActivateUndo

Make_solid= WsTrue

Stat= GLPlotOn
Pick_surface:!

E1=PickEntity("PICK RULED SURFACE")
IF (ExitScript(Destination$)) THEN Leave
IF NOT ValidGeometry(E1) THEN Pick_surface

WPKClearErrorFlag
S1=WPKMakeRuled(E1,Make_solid)

ActivateUndo
Stat= AdvanceUndoNumber("ruled body")
Stat= AddItemToUndo(WsUBPKSessionMark)
WPKErrorCheck
GOTO Pick_surface

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