×
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

CATScript : macro to import .model in a Part.

CATScript : macro to import .model in a Part.

CATScript : macro to import .model in a Part.

(OP)
Hi everybody,
Firstly, you (=admin and each member) did a great job on this forum!

Software: CATIA v5 r12

I need to import a .model file (catia v4) in a new CATPart thanks to macros. So i ran the "new macro" registering tool:
 - i open my .model (and obtain a " *MASTER ")
 - i create a new file CATPart(i want a part, not a product ;) )
 - selection of *MASTER in my .model window, copy
 - paste in my Part document
 - Finish

That's OK, no pb, i obtain the right part... but then, when i run the macro again, it crashes at the line corresponding to mySelection.Copy

Does anyone know how to program this kind of import (in CATScrpit or VB, it's very similar)?

Here is the first lines of the macro :

Language="VBSCRIPT"
Sub CATMain()

Dim documents1 As Documents
Set documents1 = CATIA.Documents

Dim partDocument1 As Document
Set partDocument1 = documents1.Add("Part")

Set documents1 = CATIA.Documents

Dim document1 As Document
Set document1 = documents1.Open("I:\myModel.model")

Set document1 = CATIA.ActiveDocument

Dim selection1 As Selection
Set selection1 = document1.Selection

selection1.Copy    <<-------- CRASH: Source: CATIASelection, Copy method failed.  
... etc...

It seems that the pb comes from the Selection of *Master: What is the type of this element? (something such as Product or Part collection). I should add a line such as slection1.Add("*Master")...

Thanks. See you soon.

RE: CATScript : macro to import .model in a Part.

(OP)
After lots of research, i found a batch for this migration... See Utils> utils (it runs catutil.exe from a catiaV5 session and you can choose differents batches).
In Catia Help, search CATV5ToV4, everything is explained.

hope it would help someone.

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