Skip to main content

A python module to access the CATIA Measurable 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’m currently just attacking the items I think will be most useful. The framework is in place for others to contribute so if you know CATIA and python please do contribute. Bonus points for adding tests too.

I have limited access to CATIA licences / workbenches so will not be able to support those I can’t test. If your company would like support for additional workbenches adding to pycatia and can provide a license please contact me.

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 fail 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.6

  • 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

If you would like to help contribute to pycatia you should start by looking at the contents of the file v5automation-autogenerated.7z contained within this repository.

This archive was created by scraping through the contents of the V5Automation.chm help file to re-construct all the classes and methods for python. It’s largely complete but won’t work out the box without some tweaking. But these files should be the basis for any pull requests. They will save you sometime and effort and ensure some consistency for the project.

If you have written a script using pycatia you would like to share you can:

Running The Tests

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 …

  • Run the tests. pytest -v tests
    • Fix any issues.

  • Run the examples.
    • Fix any issues.

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

  • Check version is correct.

  • 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.5.4.tar.gz (645.0 kB view details)

Uploaded Source

Built Distribution

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

pycatia-0.5.4-py3-none-any.whl (1.1 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pycatia-0.5.4.tar.gz
  • Upload date:
  • Size: 645.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.2

File hashes

Hashes for pycatia-0.5.4.tar.gz
Algorithm Hash digest
SHA256 fe5595c4fb9db01740e5a821d1181ca1441c3d2b04a7567f609931ff85f1448e
MD5 3c925b0b6fe97198e3aa3b03d62b73e1
BLAKE2b-256 358ba79d990c534a8e498ef10440c781836069cfe820f9524c34d969bc75e5c2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pycatia-0.5.4-py3-none-any.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.2

File hashes

Hashes for pycatia-0.5.4-py3-none-any.whl
Algorithm Hash digest
SHA256 fe1df3ee793b6f9c5acc4da39a1f6a63a0455ba50db478d7d95d68fa957056f6
MD5 8f46dab81ab5601c89fed512cdeb0a11
BLAKE2b-256 43503924c05016fe51ebc082807464ed29001c3e51cbbbc39e591c08163ab58f

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