[python-win32] Solidworks win32com AttributeError
Juha-Pekka Ahto
jpahto at gmail.com
Sun Mar 31 12:43:56 EDT 2019
Hello,
I'm sending question to this list regarding Solidworks and win32com
AttributeError.
I have created a modules from Solidworks tlb-files and am trying to get
basic functions to work.
One such is a GetTitle from IModelDoc2.
On the generated module, it's defined as:
def GetTitle(self):
'Get design table title'
# Result is a Unicode object
return self._oleobj_.InvokeTypes(8, LCID, 1, (8, 0), (),)
Traceback (most recent call last):
sw = <win32com.gen_py.SldWorks 2016 Type Library.ISldWorks instance at
0x1736352623976>
File "C:/Users/Juha-Pekka
Ahto/Desktop/CustomPropertyManager/CustomPropertyManager.py", line 24, in
<module>
uniString = swModel.GetTitle()
swModel = <win32com.gen_py.SldWorks 2016 Type Library.IModelDoc2 instance
at 0x1736369300424>
File
"C:\Users\JUHA-P~1\AppData\Local\Temp\gen_py\3.7\83A33D31-27C5-11CE-BFD4-00400513BB57x0x24x0.py",
line 34657, in GetTitle
return self._oleobj_.InvokeTypes(65607, LCID, 1, (8, 0), (),)
File "C:\Python37\lib\site-packages\win32com\client\dynamic.py", line
527, in __getattr__
raise AttributeError("%s.%s" % (self._username_, attr))
AttributeError: SldWorks.Application.24.InvokeTypes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-win32/attachments/20190331/c4097a75/attachment.html>
More information about the python-win32
mailing list