Command line automation helpers for CATIA V5 using pycatia.
catia-cli is intentionally small: it gives you reliable shell commands for
connecting to a running CATIA session, inspecting documents, and performing
common document operations.
- Windows
- CATIA V5 installed and running
- Python 3.10+
pycatia
CATIA automation is COM based. Start CATIA before running commands that connect to it.
python -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install -e .[dev]catia-cli --help
catia-cli app info
catia-cli api list start_command --limit 10
catia-cli api show pycatia.in_interfaces.application.Application
catia-cli get app.active_document.name
catia-cli call app.start_command Pad
catia-cli documents list
catia-cli documents new Part --save-as C:\work\example.CATPart
catia-cli documents open C:\work\example.CATPart
catia-cli documents save --name example.CATPart
catia-cli documents export C:\work\example.step --format stp
catia-cli documents close --name example.CATPart --savePrints basic information about the connected CATIA application and active document.
Lists open CATIA documents.
Creates a new CATIA document. TYPE must be one of Part, Product, or
Drawing.
Opens an existing CATIA document.
Saves the active document or a document selected by --name.
Closes the active document or a document selected by --name.
Exports the active document or a document selected by --name.
The api command group exposes the installed pycatia package without requiring
one hand-written CLI subcommand per CATIA interface.
catia-cli api list pad --limit 25
catia-cli api show pycatia.mec_mod_interfaces.part.Partapi list searches all public classes, methods, and properties in the installed
pycatia package. api show prints the public members of one class.
Runtime commands connect to the already-running CATIA V5 session.
catia-cli api inspect app
catia-cli api inspect app.active_document
catia-cli api inspect app.active_document.selectioncatia-cli get app.name
catia-cli get app.active_document.name
catia-cli set app.visible True
catia-cli call app.start_command Pad
catia-cli call app.active_document.save_as "C:\work\copy.CATPart"The longer api get, api set, api call, and api inspect forms still work,
but the top-level aliases are intended for day-to-day use.
Paths start at app, application, or catia. You can omit the root for
application members, so active_document.name is equivalent to
app.active_document.name.
Collection selection uses CATIA's item method when available:
catia-cli get app.documents[1].name
catia-cli get app.documents[example.CATPart].full_nameArguments are parsed as Python literals when possible. For example, True,
False, None, numbers, quoted strings, lists, and dictionaries are converted
before invoking pycatia. Unquoted values remain strings.
python -m pip install -e .[dev]
pytestThe unit tests use fakes instead of a live CATIA session. Manual CATIA testing still requires CATIA V5 to be running on Windows.