I am trying to Automate a Tool via win32com.client module which expects the Input to be in the following format,The format shown below if specific to MATLAB.
HRESULT StaticStokesParameters([in] SAFEARRAY(double) newVal)
I have no clue what does SAFEARRAY type represent. I have tried to create an 2D array in python, but i keep receiving the following error,
pywintypes.com_error: (-2147352571, 'Type mismatch.', None, 1)
I can read the values out without any problem, but when i assign the same value back as SET argument, then it fails to do so,
EngineMgr = win32com.client.Dispatch("EngineMgr")
Engine = EngineMgr.OpenEngine(0)
d_array = Engine.StaticStokesParameters
print(d_array)
**(-1.0, 0.0, 0.0) # Output of Print Statement**
Engine.StaticStokesParameters = d_array
**Traceback (most recent call last):
File "<pyshell#17>", line 1, in <module>
Engine.StaticStokesParameters = d_array
File "C:\Users\ashes\Anaconda3\lib\site-packages\win32com\client\dynamic.py", line 549, in __setattr__
self._oleobj_.Invoke(entry.dispid, 0, invoke_type, 0, value)
pywintypes.com_error: (-2147352571, 'Type mismatch.', None, 1)**