×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Conversion of CATParts into *.model files

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

RE: Conversion of CATParts into *.model files

Hi,

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

wow, what a great idea...too bad im not smart enough to do that...is there anywhere online that ppl exchange macros for v5?


RE: Conversion of CATParts into *.model files

jay24,

Wondering WHY not view them in V5?

Johnny

RE: Conversion of CATParts into *.model files

Hi there,

I will give you the script soon.

Regards
Fernando

RE: Conversion of CATParts into *.model files

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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources