Python library for Dassault Systemes CATIA

There are already some examples on this website, which explain, how to automate Dassault Systemes CATIA V5 with Python and Microsoft COM. Yesterday Paul sent me a mail and mentioned, that he has created a Python Library, which packs a few of the COM magics into a Python library with some basic functions. It covers things like, traversing assembly structures, context manager, convert files, find elements in a part, etc. Here is an example:

You can find pycatia on http://pypi.org/project/pycatia/ or on https://github.com/evereux/pycatia.

Or you can directly install it via pip in Python 3.6 by:

A batch script to convert CAD files with CATIA V5

Automated generation of a simplified drive shaft

This script creates a new CATPart including parameters, design table, rules and checks (Knowledge Advisor).

The script runs with CATIA V5 Release R15 (R14 needs minor changes in code). It supports user interface languages english and german. The code is well commented, but comments are all in german. For some more informations, look at the short documentation (german).

Print the Volume of a body from CATIA V5

Generating BOM (bill of material) from CATIA V5

To test this sample you should have installed Pywin32 and start CATIA V5 before running this script.