
! 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$[256]
DIM Point$[256]
DIM A$[512]
DIM B$[512]
DIM C$[512]
DIM Name$[512]
DIM Prop_dir$[512]
DIM Prop_class$[512]
DIM Class_dir$[512]
DIM Class_name$[512]
DIM Filename$[512]
DIM Screw_pname$[512]
DIM Namelist$[32000]
DIM D_label$[512]
DIM Choice$[512]
DIM Current_dir$[512]
DIM Ques$[512]


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


ActivateUndo
Units= CurrentUnits

Start:!
Stat= GLPlotOn
Group= GrpOfUserProps(20000,21000)

Pick_prop:!
IF NOT GroupCount(Group) THEN Leave
Stat=UserSelectBox("SCREW SECTIONS","Section selected",0,WsPropGroupSelect,Group)

Stat=SetInputFormat("a99","")
Stat=GetValue("SCREW SECTION NAME",Name$)
IF (ExitScript(Destination$)) THEN Leave
IF Name$= "CANCEL" THEN Leave

Num1= NumericPrefix(Name$)
IF NOT Num1 THEN Pick_prop
Screw_prop= GroupElement(Group,Num1)
IF NOT ValidGeometry(Screw_prop) THEN Start
Stat=DeleteEntity(Group)


List_fields:!
Namelist$= DataFieldListStr(Screw_prop,":",",",WsNoOrder,WsTrue)

D_label$="SCREW SECTION PARAMETERS"
Choice$="PARAMETER SELECTED"
Stat=GeneralListBox(D_label$,Choice$,Namelist$)

Data_field:stat= SetInputFormat("a99","",WsFalse)
stat= GetValue("SELECT PARAMETER , Replace  Calculate ",Answer$)
IF (ExitScript(Destination$)) THEN Leave
IF NOT LEN(Answer$) THEN Data_field
LowerSelectBox
SELECT Answer$
CASE "CANCEL"
	GOTO Start
CASE "Replace","replace","R","r"
	GOTO Start
CASE "Calculate","C","c","calculate"
	LOAD "vcontrol.d/lrgexecall"
END SELECT
IF POS(Answer$,"=") THEN
	A$= DataFieldStr(Answer$,"=",1)
	B$= DataFieldStr(Answer$,"=",2)
	B$= TRIM$(B$)
ELSE
	A$= Answer$
	B$=""
END IF
GOTO New_value

New_value:!
IF LEN(B$) THEN
	Stat= AddBackSlashChars(B$,C$)
	stat= SetInputFormat("a99=","",WsFalse)
	Stat= SetEqualsValue(0,C$)
	Stat=SetEditString(C$)
ELSE
	stat= SetInputFormat("a99","",WsFalse)
END IF
stat= GetValue(A$&" = ",Answer$)
IF (ExitScript(Destination$)) THEN Leave
Answer$= TRIM$(Answer$)
IF NOT LEN(Answer$) THEN New_value
Stat= BackSlashChars(Answer$,B$)
Stat= PutUserString(Screw_prop,A$&":",B$)

GOTO List_fields



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




