I am following along in the tutorials for using Staad.Pro with python but when I run:
os = comtypes.client.GetActiveObject(âStaadPro.OpenSTAADâ)
I get the error below.
When I check in regedit.exe none of the HK registries contain StaadPro.OpenSTAAD nor do the StaadPro folders contain CLSID or ProgID.
Is there something I am missing? I am using Staad at work and it is installed from a company software installation platform.
Any assistance will be greatly appreciated
OSError Traceback (most recent call last)
Cell In[5], line 4
2 from comtypes import client
3 import ctypes
----> 4 os = comtypes.client.GetActiveObject(âStaadPro.OpenSTAADâ)
File c:\Users\piet15245\OpenStaad\Test.venv\Lib\site-packages\comtypes\client_init_.py:164, in GetActiveObject(progid, interface, dynamic)
153 def GetActiveObject(progid, interface=None, dynamic=False):
154 # type: (_UnionT[str, CoClass, GUID], Optional[Any], bool) â Any
155 âââReturn a pointer to a running COM object that has been
156 registered with COM.
157
(âŚ) 162 âdynamic=Trueâ will return a dynamic dispatch object.
163 âââ
â 164 clsid = GUID.from_progid(progid)
165 if dynamic:
166 if interface is not None:
File c:\Users\xxxxx\OpenStaad\Test.venv\Lib\site-packages\comtypes\GUID.py:86, in GUID.from_progid(cls, progid)
84 return cls(progid)
85 inst = cls()
â> 86 _CLSIDFromProgID(text_type(progid), byref(inst))
87 return inst
88 else:
File _ctypes/callproc.c:1009, in GetResult()
OSError: [WinError -2147221005] Invalid class string