Conversion of CATParts into *.model files
Conversion of CATParts into *.model files
(OP)
Hi all
I have a round 20000 CATParts in V5. I need to convert all of them into *.model files so that I can view them in CATIA V4.
Instead of saving each file individually, I would like to save all the CATParts into *.model files in one shot. Is it possible? If so, How?
Regards,
Jayant
I have a round 20000 CATParts in V5. I need to convert all of them into *.model files so that I can view them in CATIA V4.
Instead of saving each file individually, I would like to save all the CATParts into *.model files in one shot. Is it possible? If so, How?
Regards,
Jayant





RE: Conversion of CATParts into *.model files
The easiest way is to create a macro and let the computer to run over night.
Regards
Fernando
RE: Conversion of CATParts into *.model files
RE: Conversion of CATParts into *.model files
Wondering WHY not view them in V5?
Johnny
RE: Conversion of CATParts into *.model files
I will give you the script soon.
Regards
Fernando
RE: Conversion of CATParts into *.model files
Here is your code,
Sub CATMain()
Set documents1 = CATIA.Documents
nume = "C:\temporary\*.*"
MyFile = Dir(nume)
MyFile1 = "C:\temporary\" & MyFile
While MyFile <> ""
documents1.Open (MyFile1)
Dim specsAndGeomWindow1 As SpecsAndGeomWindow
Set specsAndGeomWindow1 = CATIA.ActiveWindow
MyFile = Dir
Dim win1 As String
Dim product1 As Product
win1 = CATIA.ActiveWindow.name
win2 = Split(win1, ".")
win1 = win2(0)
win1 = "C:\temporary\" & win1 & ".model"
CATIA.ActiveDocument.ExportData win1, "model"
CATIA.ActiveDocument.Close
MyFile1 = "C:\temporary\" & MyFile
Wend
End Sub
I have to say that you must put all the parts in directory called temporary on C hard (or you can change the path, of course).
All the model files will be saved in the same directory.
This macro is running under Win OS, included in a CATVBA project. I didnt have the possibbility to check under UNIX. Enjoy.
Regards
Fernando