
! script name: parasolids.d/readversion
! solids: read the version of a parasolids file

!A
!A NAME:
!A
!A 	Read Solid File Version
!A
!A DESCRIPTION:
!A		
!A	This function will read the version of a parasolids file.
!A
!B INSTRUCTIONS:
!B
!B	CHOOSE EXISTING FILE FROM FILE BOX: Choose the
!B 		parasolid file you wish to import from the file box.
!B
!C NOTES:
!C	
!C	Parasolid files are denoted by the suffix .x_t or .X_T this is
!C	the text form of the parasolid storage format. 
!C
!# see also - htdocs/help.d/parasolids.htm


stat=ChangeLabelStr("ScriptNameStatus","Function: read solid file version")

DIM Destination$[256]
DIM Answer$[256]
DIM Name$[512]
DIM Mask$[512]
DIM Dir$[512]
DIM Dir1$[512]
DIM Default$[512]



Default$= "C:/usr/weber/ST/solids/"
Stat= NamedVarStr("solid file dir",WsSystemVars,Default$,Dir$)

	D_label$="DIRECTORY"
	Sub_label$="SUB DIRECTORIES"
	F_label$="FILES"
	Choice$="FILE TO OPEN"
	!            Mask$="[A-Za-z0-9]*"
	Mask$= "Parasolid Files (*.x_t)|*.x_t|"
	Mask$= Mask$&"Partition Files (*.par)|*.par|"
	Mask$= Mask$&"All Files (*.*)|*.*||"

	Stat=UserFileBox(Dir$,Mask$,D_label$,Sub_label$,F_label$,Choice$,"Synergy")
	Stat=SetInputFormat("a99","")
	Stat=GetValue("SELECT EXISTING JOB FILE",Answer$)
	IF (ExitScript(Destination$)) THEN Leave
	IF Answer$= "CANCEL" THEN Leave
	LowerFileBox
	IF NamedVarVal("save dirs",WsSystemVars,0) THEN V1=CreateVariable("solid file dir",WsSystemvars,PathNameDirectory(Answer$))
Name$= Answer$


Stat= WPKReadversion(Name$)


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