Search code examples
pythonwindowspywin32cadcatia

How to open Generative Shape Design Workbench in Catia V5 using Python WinCom API


I am using the pypiwin32 Python API for Catia V5 to try and perform some operations on a surface, operations that are in the Generative Shape Design workbench. I am referencing this code snippet I found here of someone opening the Analysis workbench.

# Activate the Generative Structural Analysis (GPS) Workbench
PartDoc=CATIA.ActiveDocument
CATIA.StartWorkbench ("GPSCfg")
CATIA.ActiveDocument.Analysis.Import(PartDoc)

I have tried changing the argument of the StartWorkBench method to "GSD" and "Generative Shape Design". What does "GPSCfg" even stand for? How do I open and interact with the Generative Shape Design workbench using this API?


Solution

  • The magic word you are looking for is "CATShapeDesignWorkbench"

    The method that reveals this word for any workbench is CATIA.GetWorkbenchId().