The seven VBA CATIA tutorials include the following topics:

Workshop 1: Fundamentals

  • How to add a macro library
  • How to open and run macros
  • How to create an icon for your macros
  • Create a “hello” message box macro

Workshop 2: Creating Your Own VBA Modules and Classes

  • Create a new class module in a new VBA library named “Messenger”.
  • Give the Messenger class a simple “Public” property and use the class in a CATIA macro.
  • Enhance the Messenger class so that the “getting” and “setting” of its properties are controlled by “Get” and “Let” methods.
  • Give the Messenger class a method called “Capitalize” that serves to manipulate the string information that is stored in its properties.

Workshop 3: Creating a Basic VBA Program from Scratch

  • Create a new module in the macro library created in Workshop 2 called myVBA_01
  • Program a routine that creates two integer variables, adds them, and then displays the result in a “message box”.
  • Create a new module with a routine using a Sub
  • Create a new module with a routine using a Function
  • Create a new module with a routine using arrays and a For loop.

Workshop 4: Objects in CATIA VBA

  • Create a new module in the macro library myVBA_01.
  • Start an “empty” CATMain() Sub.
  • Observe the properties and methods of the CATIA object.
  • Grab the Documents collection and display its Count property.

Workshop 5: Navigating a Part Document with Error Handling

  • Create a new CATPart in CATIA and create a new CATIA VBA library and module.
  • Use error handling in your code to check that the active document is a part document
  • Have the program count the number of sketch based features using error handling

Workshop 6: Creating Sketch Geometry

  • Start a new macro recording.
  • Create a sketch on the Y-Z plane that consists of a single line.
  • Open the recorded macro and observe what has been recorded.
  • Modify the macro to create additional geometry and rerun it on a new part document.

Workshop 7: Using Forms in CATIA VBA

  • Create a form in the macro library
  • Create various buttons and fields in the form.
  • Re-use code from an earlier workshop in order to add CATIA functionality and interactivity

 

VB Scripting for CATIA V5 (Second Edition) by Emmett Ross is currently available in the following formats:

Preview Edition – Includes first chapter and tutorial #3……………………………Free!
Amazon Kindle  – Abridged version does NOT include tutorials……………..$9.99(USD)
Barnes and Nobles Nook – Abridged version does NOT include tutorials….$9.99(USD)
Paperback  (includes tutorials)……………….………………………………………$59.99(USD)
eBook PDF version with tutorials (Best value, includes free updates)……..$34.99(USD)

Purchase the VB Scripting for CATIA V5 pdf to receive the seven step-by-step tutorials and begin learning CATIA VBA.