10 CATIA Macro Real World Examples
|After read through all my blog posts and articles you still may be thinking to yourself “why should I learn macro programming for CATIA?” If you’re brand new to programming it may be difficult to visualize what processes can be automated.
So what can you actually use CATIA macros for? How do they help you shave hours off your work week? I did a quick YouTube search and found the following projects that I think will give you a small idea of the power and variety of automation in CATIA.
- Drawing Customized Hole Table
Automatically make a customized table of the location coordinates for every hole in your CATPart.
Video: https://www.youtube.com/watch?v=040JO3v0hZ0
- Automatic Weight Sheet Creation
This project is a good example of how to export CATIA data to Excel.
Video: https://www.youtube.com/watch?v=AesD4bs6rBo
- Text in sketcher and 3D Text
A utility for creating texts in sketcher. It’s also able to project the sketch or develop it on a cylindrical surface.
Video: https://www.youtube.com/watch?v=mVlv7Ip0b5I
- Rename Any CATPart Elements
This Macro can be used to rename any elements in a CATIA Part where the user enters a “Prefix”, “Number” and “Suffix”.
Video: https://www.youtube.com/watch?v=RfgD1pw_WCo
- How to Model Gears
Using CATVBA, you can create a user form with a bunch of options, then click Draw and the macro program will model a new gear on-the-fly based on all the options you selected. Pretty cool!
Video: https://www.youtube.com/watch?v=Q7pERp0PfvI
- Macro for Clash Report Generation
This macro generates and exports a clash report of a CATProduct assembly to an Excel spreadsheet and lets you quickly know what parts are interfering with each other.
Video: https://www.youtube.com/watch?v=TxDnbsHZdyI
- Exploded View Management in Scene
This macro export the product’s position and saves it as XML. Then you can import/export the XML, analyze and apply it to different versions of the product in a scene.
Video: https://www.youtube.com/watch?v=fLYIwGcwTpI
- Import aero foil coordinate into CATIA
Earlier we had an example of how to export data from CATIA to Excel. This project does the opposite – takes coordinates from an Excel spreadsheet and imports them in a CATPart.
Video: https://www.youtube.com/watch?v=nP_gErfA5IQ
- Capture Navigator for FTA Data
This is a freeware application written in catvba language that displays all the captures in a part and allows you to quickly navigate through them.
Video: https://www.youtube.com/watch?v=oTo93hwu-Jc
- Screen Capture
Change the background to white, hide the specification tree, then take a screen capture. Helpful for documentation and saves on ink.
Video: https://www.youtube.com/watch?v=BZSTss1tVKk
Sometimes it helps to see the big picture and what the end goal is. I hope these examples help inspire you to take action and continue learning to automate your own processes.If you have your own or know of a cool project you would like me to add to this list, please let me know!
Trying to automate “View from 3D”. I need to get a view (which sits in an annotation set) into a 2D drawing sheet. Then manipulate. This view contains annotation I need as part of the 2D drawing. So
Set drawingViewGenerativeLinks1 = drawingView1.GenerativeLinks
does not work.
The view is the last view “Front View.1” or e.g .2 .3 .10
I am able to identify the name of the View and highlight it in 3D window.
But when i want to select this view from the drawing ..
CATIA.StartCommand “View From 3D”
partDocument1.Activate
but i can not select the view
any idea?
Hello Asad
I develop a VB program that emulate the user click on the view name (CATPart side) and the click on the drawing (CATDrawing side) with AUTOIT (MS free tool)
Does anyone have a clue how to make number 9 (Capture Navigator) here? It is really great.
Hello,
I’m interested in the topic no.3 – Text in sketcher and 3D Text.
I started making the macro but I have encountered some issues that I do not know exactly how to manage them.
Is there someone that can help me with some advices?
Have you tried contacting the person behind the YouTube account?
I tried but no answer so far.
Regarding this topic I have 3 questions:
1. Every time with the macro that I have created when the dxf is saved appears a message box ” Do you want to overwrite the file” and instead of clicking “Yes” I would like that this click to be done automatically.
2. How can I switch the windows, for example the last row in my macro is to open the dxf. Once that the dxf is opened I like to take the view (copy) and to paste it in the part document that I want. How can I switch the windows using a macro?
3. The last and the most important question. Right now in my macro I put a random text but how can I add an inputbox where I can insert the text that I want? For inserting the text that I want should I create an Excel file?