Getting Started

Before proceeding with this introduction to pycatia you should have already have pycatia installed. Visit the Installation page.

Before going through the introductory examples on this page you need to have CATIA V5 running and a CMD terminal open with the environment that has pycatia installed activated prior to starting the python interpreter.

Opening A New CATPart

You will almost always want to import the catia Application object or the CATIADocHandler 1.

from pycatia import catia
# initialise the catia automation appliction. CATIA V5 should already be running.
caa = catia()
documents = caa.documents

documents is an instance of the Documents class.


the add method of the documents class expects the string ‘Part’, ‘Product’ or ‘Drawing’. documents.add('Part') adds a new CATPart to the documents collection.

We want to work on this new document. Since this has just been added it’s the active document.

document = caa.active_document

The document object Document has a number of properties that can be accessed.
# returns the name of the new document.
# returns the pathlib.Path object of the document.

Creating A Geometrical Set

A geometrical set created using the HybridBodies collection. Your CATIA configuration may by default create a geometrical set in a new CATPart but we’ll create one here anyway.

part = document.part()
hybrid_bodies = part.hybrid_bodies
new_set = hybrid_bodies.add()
# returns the name of your new set.
# to rename the set. = 'Construction Geometry'

For more detailed examples on how to interact with pycatia see the Examples page. There contain several scripts that can be run in the terminal.



The CATIADocHandler is for those cases where you are opening and closing several documents consecutively. This will be covered at a later date in the meantime check out the Examples for examples of usage.