### Script Output Example Source: https://github.com/evereux/pycatia/blob/master/docs/create_and_run_a_script.md This is an example of the output you should expect after running the 'catia_details.py' script. ```default (env) c:\Users\\python\pycatia-scripts>python catia_details.py You are currently running CATIA V5 release XX SP XXX (env) c:\Users\\python\pycatia-scripts> ``` -------------------------------- ### Clone PyCATIA Repository and Install Source: https://github.com/evereux/pycatia/blob/master/docs/installation.md Clone the PyCATIA repository from GitHub and install it along with its requirements within a virtual environment. ```bash git clone https://github.com/evereux/pycatia.git # change directory into cloned project cd pycatia # install the python virtual env python -m virtualenv env # activate the virtual env env\Scripts\activate # install the pycatia requirements pip install -r requirements\requirements.txt ``` -------------------------------- ### Install PyCATIA from PyPI Source: https://github.com/evereux/pycatia/blob/master/docs/installation.md Use this command to install the latest stable version of PyCATIA from the Python Package Index. ```bash pip install pycatia ``` -------------------------------- ### Install Virtualenv Source: https://github.com/evereux/pycatia/blob/master/docs/installation.md Install the virtualenv module for Python using pip. This is a prerequisite for creating isolated Python environments. ```bash python -m pip install virtualenv ``` -------------------------------- ### Verify PyCATIA Installation Source: https://github.com/evereux/pycatia/blob/master/docs/installation.md Confirm a successful PyCATIA installation by importing the 'catia' object and creating a new CATPart document within the Python interpreter. ```python from pycatia import catia application = catia() help(application) # q to quit help # open a new .CATPart documents = application.documents documents.add('Part') ``` -------------------------------- ### Install PyCATIA within Virtual Environment Source: https://github.com/evereux/pycatia/blob/master/docs/installation.md Install PyCATIA using pip after activating the virtual environment. This ensures PyCATIA is installed in the isolated environment. ```bash python -m pip install pycatia ``` -------------------------------- ### Upload to PyPI Source: https://github.com/evereux/pycatia/blob/master/README.rst Distribute the built package to the Python Package Index (PyPI). Ensure you have the 'twine' package installed. ```bash twine upload dist/* ``` -------------------------------- ### Display pycatia.exe Version Source: https://github.com/evereux/pycatia/blob/master/docs/windows_builds.md Check the installed version of the pycatia.exe executable. ```bash pycatia.exe --version ``` -------------------------------- ### Create a Python Script to Get CATIA Details Source: https://github.com/evereux/pycatia/blob/master/docs/create_and_run_a_script.md This script imports the pycatia library, connects to the CATIA application, and prints the CATIA version, release, and service pack information. ```python from pycatia import catia application = catia() full_name = application.full_name sys_config = application.system_configuration release = sys_config.release version = sys_config.version service_pack = sys_config.service_pack print(f''' You are currently running CATIA V{version} release {release} SP {service_pack}. ''') ``` -------------------------------- ### Upgrade PyCATIA from PyPI Source: https://github.com/evereux/pycatia/blob/master/docs/installation.md Use this command to upgrade an existing PyCATIA installation to the latest version. ```bash pip install pycatia --upgrade ``` -------------------------------- ### Display pycatia.exe Help Options Source: https://github.com/evereux/pycatia/blob/master/docs/windows_builds.md Use this command to view all available command-line options and usage instructions for pycatia.exe. ```bash pycatia.exe -h ``` -------------------------------- ### Build documentation Source: https://github.com/evereux/pycatia/blob/master/README.rst Generate HTML documentation from the Sphinx source files. Navigate to the 'docs' directory before running this command. ```bash cd docs ./make html ``` -------------------------------- ### Initialize pycatia Application Source: https://github.com/evereux/pycatia/blob/master/docs/introduction.md Connect to an already running CATIA V5 instance. Ensure CATIA V5 is running and the environment with pycatia is activated before executing. ```python from pycatia import catia from pycatia.mec_mod_interfaces.part_document import PartDocument # initialise the catia automation application. CATIA V5 should already be running. application = catia() documents = application.documents ``` -------------------------------- ### Import Pycatia Application Source: https://github.com/evereux/pycatia/blob/master/docs/api_index.md This snippet shows the standard way to import the pycatia library and create an instance of the Application object, which is the entry point for most pycatia use cases. ```python >>> from pycatia import catia ``` -------------------------------- ### Activate the Virtual Environment Source: https://github.com/evereux/pycatia/blob/master/docs/create_and_run_a_script.md Run this command to activate the Python virtual environment for your project. ```default env\Scripts\activate ``` -------------------------------- ### Build source distribution and wheel Source: https://github.com/evereux/pycatia/blob/master/README.rst Create a source distribution (sdist) and a wheel binary distribution for the pycatia package. These are used for uploading to PyPI. ```python python setup.py sdist bdist_wheel ``` -------------------------------- ### Run the Python Script Source: https://github.com/evereux/pycatia/blob/master/docs/create_and_run_a_script.md Execute your Python script from the command line using the 'python' command followed by the script name. ```default (env) c:\Users\\python\pycatia-scripts>python catia_details.py ``` -------------------------------- ### Register CATIA V5 COM Server Source: https://github.com/evereux/pycatia/blob/master/docs/installation.md Manually register the CATIA V5 COM server using the cnext.exe command. This is a troubleshooting step if automatic registration fails. ```bash cnext.exe /regserver -env -direnv ``` -------------------------------- ### Run a PyCATIA Python Script Source: https://github.com/evereux/pycatia/blob/master/docs/windows_builds.md Execute a specified Python script using the pycatia.exe. Ensure the script file path is correct. ```bash pycatia.exe example_014.py ``` -------------------------------- ### Create Virtual Environment Source: https://github.com/evereux/pycatia/blob/master/docs/installation.md Create a new virtual environment named 'env' for your Python project. This isolates project dependencies. ```bash python -m virtualenv env ``` -------------------------------- ### Build standalone executable with Nuitka Source: https://github.com/evereux/pycatia/blob/master/README.rst Compile the pycatia executable into a standalone application using Nuitka. Ensure you are using a 64-bit environment. ```python python -m nuitka --standalone pycatia-exe.py ``` -------------------------------- ### Run pytest tests Source: https://github.com/evereux/pycatia/blob/master/README.rst A simplified command to run pytest tests. Ensure CATIA V5 is configured correctly and all necessary files are present. ```python pytest -v tests ``` -------------------------------- ### Add New CATPart Document Source: https://github.com/evereux/pycatia/blob/master/docs/introduction.md Creates a new CATPart document within the CATIA session. The `add` method accepts 'Part', 'Product', or 'Drawing' as arguments. ```python part_document: PartDocument = documents.add('Part') ``` -------------------------------- ### Run pytest with coverage Source: https://github.com/evereux/pycatia/blob/master/README.rst Use this command to run all tests with coverage reporting. Ensure CATIA V5 is running with no documents open and specific configuration settings are applied. ```python py.test -v --cov-report term-missing --cov=pycatia ``` -------------------------------- ### Access Document Properties Source: https://github.com/evereux/pycatia/blob/master/docs/introduction.md Retrieve the name and file path of a CATIA document. The path is returned as a `pathlib.Path` object. ```python part_document.name # returns the name of the new document. part_document.path # returns the pathlib.Path object of the document. ``` -------------------------------- ### Navigate to the pycatia Scripts Directory Source: https://github.com/evereux/pycatia/blob/master/docs/create_and_run_a_script.md Use this command in the CMD terminal to change the current directory to your pycatia scripts folder. ```default cd c:\Users\\python\pycatia-scripts ``` -------------------------------- ### Run mypy type checking Source: https://github.com/evereux/pycatia/blob/master/README.rst Perform static type checking on the pycatia module using mypy. This helps in identifying type-related errors. ```python mypy pycatia ``` -------------------------------- ### Run a specific pytest test Source: https://github.com/evereux/pycatia/blob/master/README.rst Execute a single test case by specifying its path and name. This is useful for debugging specific functionalities. ```python py.test -v tests/test_product.py::test_move ``` -------------------------------- ### Stop pytest after first failure Source: https://github.com/evereux/pycatia/blob/master/README.rst Configure pytest to halt execution immediately after the first test failure. This can speed up the debugging process. ```python py.test -vx ``` -------------------------------- ### Create New Geometrical Set Source: https://github.com/evereux/pycatia/blob/master/docs/introduction.md Adds a new geometrical set to the active CATPart. This is useful for organizing geometry. The name of the set can be accessed and modified. ```python part = part_document.part hybrid_bodies = part.hybrid_bodies new_set = hybrid_bodies.add() new_set.name # returns the name of your new set. # to rename the set. new_set.name = 'Construction Geometry' ``` -------------------------------- ### Exit Python Interpreter Source: https://github.com/evereux/pycatia/blob/master/docs/installation.md Command to exit the Python interactive interpreter. ```python exit() ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.