Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

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

Status
Not open for further replies.

JayEnn1

Automotive
Sep 29, 2015
50
US
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.
 
Replies continue below

Recommended for you

did you check your V5Automation.chm ?

Eric N.
indocti discant et ament meminisse periti
 
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.
 
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
 
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!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Top