×
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

CatiaV5 macro to save selected part/product(s) with filename same as part number.

CatiaV5 macro to save selected part/product(s) with filename same as part number.

CatiaV5 macro to save selected part/product(s) with filename same as part number.

(OP)
Hello!

Our design manager asked for a CatiaV5 script that will save the selected/active CatPart(s) or CatProduct(s) using the
part number as the new filename. I am very efficient with MS Excel VBA but new to CatiaV5 VBA. Can anybody help
with such a script? It would help me learn some of the unique aspects of CatiaV5 VBA.

RE: CatiaV5 macro to save selected part/product(s) with filename same as part number.

did you check your V5Automation.chm ?

Eric N.
indocti discant et ament meminisse periti

RE: CatiaV5 macro to save selected part/product(s) with filename same as part number.

(OP)
Good morning and thank you for your reply posts!
I did try recording a script but results were not that helpful. 100% of my scripting knowledge is with
Microsoft Excel and I consider my skill level to be good. I am brand new to CatiaV5 and at ground zero
with CatiaV5 specific programming.

No I have not yet tried to script anything yet. I did buy the book CatiaV5 macro programming by D. Ziethen
and just starting to learn the Catia VBA side of things.

This is what I would like to automate.
1. Select a CatPart or a CatProduct.
2. Obtain the properties part number value of the selected object.
3. Obtain directory path of the top level assembly CatProduct file.
4. File save the selected CatPart or CatProduct using a filename equal to the properties part number.
and in the same directory as the top level CatProduct. ( Ignoring file save overwrite warning/error messages )

Right now our designers are doing this manually for each part/product -> double click on the object, get properties
part number ( copy ) then do a file save as and ( paste ) the name in. Very repetitious work especially when you
have a larger design.

RE: CatiaV5 macro to save selected part/product(s) with filename same as part number.

This could be done easy with minimal understanding of CATIA object structure and APIs.

Please go get some info by reading the V5Automation.CHM file , there are many scirpt you can learn from and all Object, Methods, properties... from CATIA.

Also you can find many good exemple in Ferdo's compilation here.

By reading few scripts you should be able to put something together. Share your code if you have problem, we will help (but I won't code for free).

waiting for your post.

Eric N.
indocti discant et ament meminisse periti

RE: CatiaV5 macro to save selected part/product(s) with filename same as part number.

(OP)
OMG !!!!
The V5Automation.CHM file is what I was searching for! Didn't know that existed.
( Didn't quite understand Eric's earlier post, thought he was referring to recording a macro )

That alone should get me moving forward!
THANK YOU VERY MUCH!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

RE: CatiaV5 macro to save selected part/product(s) with filename same as part number.

(OP)
Question,
I checked Ferdo's compilation, downloaded the CHM file and opened it up but
it won't display examples or info. All I get is a table of contents. Am I doing
something wrong. The CHM in my Catia folder worked great.

RE: CatiaV5 macro to save selected part/product(s) with filename same as part number.

(OP)
Thank you VERY much!

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