
! script name: vpksolids.d/vpktwinextruder
! solids: twin extruder screw shape
!A
!A NAME:
!A
!A 	Variable Pitch Twin Extruder Screw:   VARIATIONAL
!A
!A DESCRIPTION:
!A
!A	This script creates a simple variable lead screw.
!A
!B INSTRUCTIONS:
!B		NUMBER OF FLIGHTS: Number of flights
!B
!B		Left or Right HAND SCREW: Is the screw left or right hand.
!B
!B
!B NOTES:
!B
!B
!B
!# see also - htdocs/help.d/parasolids.htm

Stat=ChangeLabelStr("ScriptNameStatus","Function: var lead twin extruder ")

OPTION BASE 1
DIM Destination$[256]
DIM Answer$[256]
DIM Name$[512]
DIM Prop_dir$[512]
DIM Screw_dir$[512]
DIM Screw_name$[512]
DIM Prop_file$[512]
DIM D_label$[512]
DIM Choice$[512]
DIM Ques$[512]



Var_object= CheckVarObject
IF (ExitScript(Destination$)) THEN Leave


ActivateUndo
Units= CurrentUnits

Start:!
Stat= GLPlotOn

Prop_dir$="/usr/weber/database/properties/ExtrusionScrews.d/"

Start:!
DeActivateUndo
D_label$="SCREW DATA"
Choice$="SCREW DATA SELECTED"
Ques$= "SCREW DATA"
Answer$= SelectDirectory(Prop_dir$,"*",Ques$,D_label$,Choice$,"",Current_dir$)
IF (ExitScript(Destination$)) THEN Leave
IF Answer$= "CANCEL" THEN Leave
Answer$= TRIM$(Answer$)
Screw_dir$= Answer$
Screw_name$= PathNameFile(Screw_dir$)

Screw_group= PDirSearchValGrp(Screw_dir$,"Class id number:",0,0,20000,20020)
Stat= NameEntity(Screw_group,Screw_name$)
IF NOT ValidGeometry(Screw_group) THEN Leave

Make_record:!
PlotAll
WPKClearErrorFlag
Stat= GenerateVarName(WsGroupEnt,Name$)
RecordFunctionOn
Stat= RecordDescr("EXTRUSION SCREW: Twin extruder")
Stat= DisplayMessage("PROCESSING SCREW")
Stat=PrintToVarRecord("WPKEndSession")
Workr= CurrentWorkplane
Stat= SetWorkplane
Pt= PointXYZ(0,0,0)
T1=AngleTransform(Pt,90,-90,0)
Stat=SetWorkplane(T1)
Stat= DeleteEntity(Pt)
Bodygroup= WPKTwinScrewZone(Screw_name$)
Stat= WPKNameBodyGroup(Bodygroup,Name$)
Stat= WPKSetBodyParent(Bodygroup,1)
Stat= DeleteEntity(Bodygroup)
Stat=SetWorkplane(Workr)
RecordFunctionOff
Curr_record= CurrentVarRecord
CloseVarRecord

Stat= WPKSolidRecordOn(Curr_record)
ActivateUndo
Stat= AdvanceUndoNumber("twin extruder screw")
Stat= AddItemToUndo(WsUBPKSessionMark)
Stat= AddItemToUndo(WsUBCreateMode,Curr_record)
! WPKErrorCheck

ResizeAll


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




