Solidworks API pass-by-reference
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
When you run makepy on the SolidWorks api, it gets confused on any of the methods that use pass-by reference. In particular, to anyone trying to do automation using OpenDoc6 runs into the problem of the errors and warnings arguments which are pass-by reference being considered non-optional, even though they are return values.
A fairly in-depth discussion and possible workarounds can be found at: http://ephemeralvalue.com/?p=16
and http://mail.python.org/pipermail/python-list/2002-December/175880.html
Is there a way to make makepy not get confused on these methods, or is this just a function of the SolidWorks API?
Logged In: YES
user_id=14198
Originator: NO
The solution would seem to be to call the function like:
model, errors, warnings = sw.OpenDoc6( 'cube.sldprt', constants.swDocPART, constants.swOpenDocOptions_Silent, '', pythoncom.Missing, pythoncom.Missing )
?
Please reopen this if I'm missing something. Sadly, I can't change the defaults as that would cause many other things to break...