You are on page 1of 4

7 Resources for CATIA Macro Programmers

Emmett Ross
http://www.scripting4v5.com
Heres a list of seven resources I use almost every day when programming macros in CATIA V5.
1. CATIA Visual Basic Help File
The CATIA Visual Basic Help Documentation (also known as CATIA Automation Documentation) can be
accessed using either the online help (if the complete CATIA Documentation is not installed) or by
opening the file:
<Catia_install_folder>\intel_a\code\biV5Automation.chm.
Navigate to the directory B18\intel_a\code\bin, right-click on the file V5Automation.chm, and choose
"Create Shortcut", which will create a shortcut to this file in this same directory. Move the shortcut to
your desktop and double-click on it to open it.
To navigate the CATIA object diagram click on the Contents tab, expand the CAA V5 Visual Basic
Reference node and then select CAA V5 Objects. The CATIA Object Diagram shown in the help files is
colored coded and distinguishes objects from abstract objects and collections. I use this all the time!

2. CATIA Object Browser


Another built in feature that can help you solve your problems is the CATIA object browser and is a great
tool to use when youre stuck and dont know what to do next. While in the CATScript editor go to
View>Object Browser (or simply hit F2) and use the search bar. Documentation can be found from within
the CATIA VBA editor by way of the menu. Go to View>Object Browser or simply hit F2.

Lets say you want to figure out how to create a new rib feature. Open the VBA Object Browser and type
rib into the search bar. Look in the third column (member) for anything something that makes
sense, in this case AddNewRib looks good. The second column (class) will tell you what object is
needed to use the function. At the bottom of the window youll see how to use the function and what
inputs are needed. This is the first step to take when youre stuck.

3. Flowchart Process Diagrams


When youre programming a complicated macro its often a good idea to visualize how its going to work
before you start typing away. For these large problems I like to create flowcharts to get an overall idea
of how the code will flow. It also helps to think about the steps the macro will need to perform,
including all the user inputs. I often write out a flowchart, decision tree, or quickly sketch a process map.

My favorite tool for this task is Draw.IO because its free and it lets you create flowcharts right in your
internet browser and you can save your charts directly into Google Drive, DropBox, etc.
Begin sketching flowcharts here: https://www.draw.io/

Another option is to use something simple like Excel, Word, PowerPoint, or Snagit, like I did with this
flowchart:

4. VB Script Functions
No, I havent memorized every single function that can be used in VB. Instead, I prefer to know where that
information is and simply look it up really fast. This page contains all the built-in VBScript functions, like Date,
Array, IsEmpty, etc.

VB Script functions: http://www.w3schools.com/vbscript/vbscript_ref_functions.asp

5. Existing Macro Codes


Its easier to start with code you know works rather than writing everything from scratch. I almost
always start a new macro by taking snippets of code from macros Ive written earlier. If youre new to
programming and dont have a pool of macros to pull from you can use some of mine. Ive already sent
you the ten I use the most. For more, check out the downloads page on my website:
http://www.scripting4v5.com/downloads/

6. Notepad++
Sometimes you dont necessarily need CATIA to write your code, just a good notepad tool to help you
get the job done. You could use Notepad, Wordpad, or Microsoft word, but instead I recommend and
absolutely love Notepad++. I use it all the time for tasks like: looking through other programmers code,
record macros, compare text files for differences, view/edit files. Its much better than using plain ole
Notepad. Its also where I compile all my examples and tutorials before copying them to my website or
book pages.
Download for free here: http://notepad-plus-plus.org/

7. Eng Tips / COE / Stackoverflow / CATIA Macro Forum


When Im completely stumped by a programming problem I turn to forums where I can get potential
solutions from over programmers. The forums listed are all simple to setup an account at and you can
start posting questions right away. Often times, other programmers have had the exact same question
and you can find the solution by searching the forums. So if youve gone throw tons of Google search
pages and are still pulling your hair out, got to one of these forums and get the answer you need.

Eng Tips: http://www.eng-tips.com/threadminder.cfm?pid=560


COE: http://www.coe.org/p/cm/ld/fid=79
Stackoverflow: http://stackoverflow.com/search?q=catia
CATIA Macro Forum: http://www.scripting4v5.com/forums/

Thank you for reading! Questions or comments? Let me know if there are any other resources you use
almost every day. Contact me: Emmett@scripting4v5.com
Want to learn all the ins-and-outs of CATIA macro programming in one convenient location? Then join
my Quick Start Guide CATIA Macro Email course now, the fastest path towards automating your boring
tasks.
http://www.scripting4v5.com/catia-macro-email-course

You might also like