Working with ByRef arrays in CATIA

This is not actually a script, but a solution I’ve found to a huge roadblock I encountered while trying to use Python to automate CATIA V5 using win32com AND use all funcionalities exposed to automation.

We all know it’s very easy to get started by just using late-binding (dynamic dispatch) and the more advanced users will already know that it will be not possible to use Subs that need Byref arrays. Developers of win32com related stuff are aware of the problem but not to the fact that in some applications these kind of Sub are very intensively used i.e. all subs to get triplets such as GetCoordinates of any class derived from the Point class, or GetFirstAxis of any class derived from the Plane class.
Developers state that it’s sufficient to switch to early bindig using makepy to solve the problem but in my case for CATIA V5 R19 it didn’t solve the problem at all, it even added more problems. Continue reading “Working with ByRef arrays in CATIA”

Python library for Dassault Systemes CATIA

There are already some examples on this website, which explain, how to automate Dassault Systemes CATIA V5 with Python and Microsoft COM. Yesterday Paul sent me a mail and mentioned, that he has created a Python Library, which packs a few of the COM magics into a Python library with some basic functions. It covers things like, traversing assembly structures, context manager, convert files, find elements in a part, etc. Continue reading “Python library for Dassault Systemes CATIA”