Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Conversion of CATParts into *.model files

Status
Not open for further replies.

jay24

Mechanical
Mar 30, 2003
18
0
0
IN
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
 
Replies continue below

Recommended for you

Hi again,

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
 
Status
Not open for further replies.
Back
Top