Re: Run solidworks macro from python.

Tim Roberts <[email protected]> Tue, 15 Feb 2022 09:31:26 -0800
Newsgroups gmane.comp.python.windows
Organization Providenza & Boekelheide, Inc.
Message-ID <[email protected]>
Sanaa Mouzahir wrote:
>
> Apologies for the late reply, I had to go through a lot of 
> documentation regarding SolidWorks itself. Unfortunately, the 
> available documentation that I find is regarding creating a SW COM 
> object, however, nothing about running a macro already written in 
> SolidWorks VB. More specifically, when I look up 'swbindings.py' I do 
> not get any output, and if I try to import it, I get the error message 
> 'no module named swbindings'.

Anything you can do from VBA can be done from Python, and it's usually a 
one-for-one translation.  Somewhere in the SolidWorks object model 
documentation, there has to be a command to run a named VBA script.  
That's what you need to find.  The key is that this is not Python 
related.  You're just controlling their COM server, so you need to find 
the right method in the right interface in their object model.

-- 
Tim Roberts, [email protected]
Providenza & Boekelheide, Inc.

_______________________________________________
python-win32 mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-win32
smime.p7s (application/pkcs7-signature, 3.3 KB) - not displayed