Skip to main content

A python module to interface with the CATIA V5 COM object.

Project description

alpha software

This is alpha software.

All the test cases and examples work but there will be many issues outside of the test framework. The CATIA com interface is huge and I’ve predominantly only worked / tested on those I can figure out how to use.

The entire framework is now in place for others to contribute so if you know CATIA and python (being already familiar with automation using the more traditional methods will help) please do contribute. Bonus points for adding tests too.

I have limited access to CATIA licences / workbenches. Also, there’s are many modules that I simply don’t know what they do. Thus my ability to test things is extremely limited.

All this said many bugs that exist should be for the most part be quite easy to fix using those methods that do work as a reference.

Why was it made?

pycatia was initially created to access the CATIA Automation Measurable object and it’s methods without the need of visual basic / CATScripts.

Some of the methods can be accessed directly using the pywin32 module but there are a number that just simply won’t work using python. There are several questions on stack overflow and the pywin32 mailing list regarding this. But, they failed to provide any working examples with the Measurable object in python.

pycatia accesses these methods by running VBA scripts using the Dispatch(‘CATIA.Application’).SystemService.Evaluate() function and passing a public function to it. Otherwise, pycatia uses the VB method directly but exposes it within the same python class.

There is now further functionality available which can be seen by looking at the examples provided and reading the API at pycatia.readthedocs.io.

Requirements

  • python >= 3.9

  • CATIA V5 running on Windows.

  • see requirements.txt

Installation

see installation.

Usage

See the introduction and examples provided via the documentation link.

Examples

See the documentation @ examples.

Asking Questions

Please read the following with regards to raising questions: https://github.com/evereux/pycatia/issues/28

Please do not email me directly requesting support unless this is business related and you would like professional support.

Contributing

See CONTRIBUTING.md in root of github repository.

Running The Tests

Prior to running the tests please ensure CATIA V5 has the following configuration settings:

  • CGR cache system must be disabled.

  • Parameter names must not have back ticks enabled. Tools > Options > General > Parameters and Measure > Knowledge > Parameter Names > Surrounded by the ` symbol.

On the first run, during the running of the tests, the test suite will create the CATIA drawing, products and part it requires to run in the folder tests/cat_files.

CATIA V5 should already be running and have NO documents already open.

To run the tests with coverage (-v is verbosity):

py.test -v --cov-report term-missing --cov=pycatia

To run a specific test:

py.test -v tests/test_product.py::test_move

To stop tests running after first failure.

py.test -vx

Release process

A reminder for @evereux. I don’t do this often and forget …

  • Check version is correct.

  • Check changelog has been updated.

  • Run the tests. pytest -v tests
    • Ensure cache is disabled and

    • Fix any issues.

  • Run the examples.
    • Fix any issues.

  • Build the docs. cd docs make html
    • Fix any issues.

  • Run mypy over module. mypy pycatia

  • Build source. python setup.py sdist bdist_wheel
    • Check source contents.

  • Build pycatia exe python -m nuitka --standalone pycatia-exe.py. * use 64 env. * rename pycatia-exe.exe. * copy build to win_32 folder and zip.

  • Merge changes with master branch and upload.

  • Upload to pypi. twine upload dist/*.

  • Update github releases.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pycatia-0.6.1.tar.gz (1.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pycatia-0.6.1-py3-none-any.whl (2.5 MB view details)

Uploaded Python 3

File details

Details for the file pycatia-0.6.1.tar.gz.

File metadata

  • Download URL: pycatia-0.6.1.tar.gz
  • Upload date:
  • Size: 1.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.3 readme-renderer/37.3 requests/2.28.1 requests-toolbelt/0.10.1 urllib3/1.26.12 tqdm/4.64.1 importlib-metadata/5.0.0 keyring/23.11.0 rfc3986/2.0.0 colorama/0.4.6 CPython/3.10.11

File hashes

Hashes for pycatia-0.6.1.tar.gz
Algorithm Hash digest
SHA256 0da1aa9b525282827cddb7cf6807519c48d9abbba688d0b16ebf74d70462ddaa
MD5 dccbe1d37276b5655722b004ef357057
BLAKE2b-256 1382a08a279b788f2f2b8e7b7e038a943e41e431bb3b132e507fa8f992f32e9a

See more details on using hashes here.

File details

Details for the file pycatia-0.6.1-py3-none-any.whl.

File metadata

  • Download URL: pycatia-0.6.1-py3-none-any.whl
  • Upload date:
  • Size: 2.5 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.3 readme-renderer/37.3 requests/2.28.1 requests-toolbelt/0.10.1 urllib3/1.26.12 tqdm/4.64.1 importlib-metadata/5.0.0 keyring/23.11.0 rfc3986/2.0.0 colorama/0.4.6 CPython/3.10.11

File hashes

Hashes for pycatia-0.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ce81a5f6f457eda75ece1bbb28c7b86aef6bcbbb74708c8aa76ee6dcd8f34b80
MD5 9b3deaecce5c7c25fbc4c2401fb436e8
BLAKE2b-256 0352d6456f7e0e67ce6ea3d80b03cd0c9b7354a07d751866cb895889d15b6b60

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page