Archive for the ‘The CATIA Object Model’ Category

Measuring Mass and Inertia

October 27, 2010 27 comments

You have probably used the Inertia measure function in CATIA to get mass and inertia measures but did you know that you can automate those measurements as well?  The inertia object that you may use in your programs works just like the interactive command and provides all the same capabilities you are used to.  In this article, I will show how to program with the inertia object and as usual I will provide sample code and some handy reusable functions. Read more…


Working with restricted interfaces

July 29, 2010 9 comments

Often times when coding in VBA, you may get an error message that says, “Function or interface marked as restricted, or the function uses an Automation type not supported in Visual Basic.”  In this article, I will explain the reason for this error and present a good strategy to deal with it. Read more…

Developing proper names to use in product relations

May 24, 2010 5 comments

Developing proper names to use in product relations

In the last article, I introduced some scenarios where you need to develop the proper name of an object to use in a part relation. This article follows up by discussing some other scenarios where the relation is created in a product and refers to various objects in both parts and products. Read more…

Developing proper names to use in part relations

May 11, 2010 3 comments

There are times when you may need to create a relation (formula, rule, law, etc.) using automation.  CATIA refers to parameters, geometry and other objects inside those relations based on their name so to accomplish this you will need to understand how to develop those names properly.  There are many different ways to express the name of an object inside a relation depending on where the relation is located and where the object it is referring to is located.  In this article, I will cover how to develop names of objects inside a part when the relation is also created in the same part. Read more…

Checking CATIA licenses at runtime

March 23, 2010 7 comments

The CATIA automation API provides an extensive set of functionality across many different workbenches. Depending on what functionality your program will provide, you may need to consider what licenses are required. In this article, I will show how to add code to your program to check whether certain licenses have been granted. Read more…

Efficiently navigating parameter collections

March 4, 2010 8 comments

Many times over the years, I have seen a common problem posted in CATIA forums.  The problem is that some macro runs great on smaller parts or products, but it slows down tremendously on larger ones.  The programmer has noticed that the slowness happens when trying to retrieve a parameter from a parameters collection.  Fortunately, the problem is very easy to correct.  In this article I will show how to work with smaller parameter collections to boost performance and also show how to more reliably get at the specific parameters you need. Read more…

Using file open and save dialogs

February 8, 2010 12 comments

Many programming projects require the user of the program to specify either a file to open or save.  That file could be anything from a native CATIA file such as a CATPart or CATDrawing to a simple text file.  Luckily, the CATIA automation API provides methods to display familiar file dialogs just like those you see in any other Windows application.  In this article I will show how easy they are to incorporate into your programming project and also how to deal with some common file related issues. Read more…