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 contribute. Bonus points for adding tests too.

Why was it made?

pycatia was primarily created to access the CATIA API Measurable object and it’s methods without the need of visual basic / CATScripts. There is further functionaliy available which can be seen by looking at the examples provided and reading the API at pycatia.readthedocs.io.

Some of the methods can be accessed simply using the pywin32 module but further access to methods such as GetCOG do not seem to be accessible using pure 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 VB Measurable object in python.

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

Requirements

  • python >= 3.6

  • CATIA V5

  • see requirements.txt

Installation

with pip

pip install pycatia

For more detailed instructions please refer to the installation instructions available at pycatia.readthedocs.io.

Usage

See the examples provided.

Examples

Asking Questions

Please don’t raise an issue here until you have read the documentation, understood and met the requirements (YOU NEED CATIA INSTALLED) and have run the examples.

If you are upgrading from an earlier versions and your scripts break please check the changelog to give you clues on what to do to resolve those issues.

Once you have done that please give as much information as you can so I may try and reproduce the issue. Please provide the following information:

  • Windows OS version

  • CATIA version

  • Python version

  • pycatia version

  • Your code!

  • Full stack trace of error you encounter (properly formatted text please, not picture).

Thanks! :-)

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.

Running The Tests

To run the tests with coverage:

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

To run a specific test:

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

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.3.0a0.tar.gz (498.1 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.3.0a0-py3-none-any.whl (837.4 kB view details)

Uploaded Python 3

File details

Details for the file pycatia-0.3.0a0.tar.gz.

File metadata

  • Download URL: pycatia-0.3.0a0.tar.gz
  • Upload date:
  • Size: 498.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.2

File hashes

Hashes for pycatia-0.3.0a0.tar.gz
Algorithm Hash digest
SHA256 a287c6281a33aa722692e59b67c15651bc6885937058207fcc4fe334741d1c36
MD5 ce43442bbe4ae257f5d8f151cbec47a9
BLAKE2b-256 93190056b3b28bdad06e7ce6140e8724a666f2854a854a9bf4dcda257ee3a887

See more details on using hashes here.

File details

Details for the file pycatia-0.3.0a0-py3-none-any.whl.

File metadata

  • Download URL: pycatia-0.3.0a0-py3-none-any.whl
  • Upload date:
  • Size: 837.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.2

File hashes

Hashes for pycatia-0.3.0a0-py3-none-any.whl
Algorithm Hash digest
SHA256 79db625dbfaac23a97cad3de3bd332a6e0f8cacc7528d94fe6c96b0b6ec85e31
MD5 69c6b5afaeecc30c11345bbef46698cf
BLAKE2b-256 aba1d08c18d4459d29a6fbcbbc9110a4da21982892b2ba835cdf2bcffaa5d6be

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