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”
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”
I use this script for years and I`m very happy with it. Simply select a file or directory in Windows Explorer and copy it`s path to the clipboard directly from the context menu.
To install it, run a command shell as admin and call the script without an argument. After that it is installed and can be used from the context menu.
Grig Gheorghiu wrote on blogspot.com a howto for installing Python Scripts as Windows Services. It uses instsrv.exe and srvany.exe from the Win2K Ressource Kit.
The class I found on Activestate wraps most of the win32api functions for accessing a registry. It will read and write all win32 registry types, and will de/serialize python objects to registry keys when a string or integer representation is not possible: