Cad Engineer Reveals How To Write Macros For Catia V5, A 3d Cad Program Used In The Automotive And Aerospace Industries.
With this VB Scripting for CATIA V5: Expanded Edition eBook you can learn to create the perfect macro to automate your time consuming processes. If you hired an engineering services company to write macros for you or your company it would cost you thousands of dollars. Why not teach yourself and impresses your bosses? The evolution of an engineer is all about continuous learning.
I’ve created hundreds of macros and included some example codes in the book. This 159 page ebook come as a downloadable pdf file which you can view right on your PC; eReader not required!
The seven 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