This is small application shows how to automate the CAD/PLM Software CATIA V5 via win32com. CATIA V5 must be installed and should be running when testing the application. Other examples you can find on http://win32com.goermezer.de/content/view/29/291/ .
Python, 15 lines
If you want to use early binding for the CATIA V5 object libraries you can use the Makepy utility from Pythonwin. After that every object and its methods will be usable from the pulldown menu of Pythonwin while typing and you can have a performance advantage. You should use makepy for every object library which you want to use e.g. "ProductStructure Object Library" for working with CATProducts). But not for the "CATIA V5 Interfaces Objekt Library"!
If you do that every application which uses early binding for the "CATIA V5 Interfaces Objekt Library" will not work ! A workaround is not to use makepy for the "CATIA V5 Interfaces Objekt Library" or use explicit late binding "(import win32com.client.dynamic as the first line).
If you have problems to access the COM Interface from CATIA V5 (eg. no object libraries from CATIA V5 in makepy) please check whether CATIA V5 was registrated as a COM server. If not you can do that with cnext.exe /regserver in the CATIA V5 bin-directory. Then everything should work well...