From mmontoya at inge-concreto.com Tue Jul 11 13:19:49 2023 From: mmontoya at inge-concreto.com (Mateo Gomez Montoya) Date: Tue, 11 Jul 2023 12:19:49 -0500 Subject: [python-win32] Question win32com.client.Dispatch Message-ID: Hello, I'm trying to use the command of win32com.client.Dispatch("AutoCAD.Application") and on the computer that I'm working with there are two versions of AutoCAD one from 2007 and another from 2021. I want to use a program that I created with the most recent version but when I run my code it automatically opens up AutoCAD2007. How can I create a dispatch that will run the most recent version of AutoCAD no matter the computer? P.S I don't want to uninstall the 2007 version since it runs some of my older programs. Thank you -------------- next part -------------- An HTML attachment was scrubbed... URL: From steven at manross.net Tue Jul 11 14:45:20 2023 From: steven at manross.net (Steven Manross) Date: Tue, 11 Jul 2023 18:45:20 +0000 Subject: [python-win32] Question win32com.client.Dispatch In-Reply-To: References: Message-ID: When building your ?AutoCad.Application? object, it looks like 2007 is the default object? In your computer?s registry directly under HKEY_CLASSES_ROOT you should be able to find a Key (FOLDER icon) that matches that name? as well, IF AutoCAD has different versions installed , you should be able to see ?AutoCad.Application.#######? as well, which should be the COM Object name for the specific version you are looking for. While I don?t have AutoCad installed, Microsoft Excel is an application that goes about this the same way? If I had 2+ versions of Excel installed, I would send ?Excel.Application.16? to work with for my currently installed version of Office 2019. I hope this helps. Steven From: python-win32 On Behalf Of Mateo Gomez Montoya Sent: Tuesday, July 11, 2023 10:20 AM To: python-win32 at python.org Subject: [python-win32] Question win32com.client.Dispatch Hello, I'm trying to use the command of win32com.client.Dispatch("AutoCAD.Application") and on the computer that I'm working with there are two versions of AutoCAD one from 2007 and another from 2021. I want to use a program that I created with the most recent version but when I run my code it automatically opens up AutoCAD2007. How can I create a dispatch that will run the most recent version of AutoCAD no matter the computer? P.S I don't want to uninstall the 2007 version since it runs some of my older programs. Thank you -------------- next part -------------- An HTML attachment was scrubbed... URL: From mmontoya at inge-concreto.com Tue Jul 11 15:23:38 2023 From: mmontoya at inge-concreto.com (Mateo Gomez Montoya) Date: Tue, 11 Jul 2023 14:23:38 -0500 Subject: [python-win32] Question win32com.client.Dispatch In-Reply-To: References: Message-ID: Very helpful, thank you! El mar, 11 jul 2023 a las 13:45, Steven Manross () escribi?: > When building your ?AutoCad.Application? object, it looks like 2007 is the > default object? > > > > In your computer?s registry directly under HKEY_CLASSES_ROOT you should be > able to find a Key (FOLDER icon) that matches that name? as well, IF > AutoCAD has different versions installed , you should be able to see > ?AutoCad.Application.#######? as well, which should be the COM Object name > for the specific version you are looking for. > > > > While I don?t have AutoCad installed, Microsoft Excel is an application > that goes about this the same way? > > > > If I had 2+ versions of Excel installed, I would send > ?Excel.Application.16? to work with for my currently installed version of > Office 2019. > > > > I hope this helps. > > > > Steven > > *From:* python-win32 *On > Behalf Of *Mateo Gomez Montoya > *Sent:* Tuesday, July 11, 2023 10:20 AM > *To:* python-win32 at python.org > *Subject:* [python-win32] Question win32com.client.Dispatch > > > > Hello, > > > > I'm trying to use the command of > win32com.client.Dispatch("AutoCAD.Application") and on the computer that > I'm working with there are two versions of AutoCAD one from 2007 and > another from 2021. I want to use a program that I created with the most > recent version but when I run my code it automatically opens up > AutoCAD2007. How can I create a dispatch that will run the most recent > version of AutoCAD no matter the computer? > > > > P.S I don't want to uninstall the 2007 version since it runs some of my > older programs. > > > > Thank you > -------------- next part -------------- An HTML attachment was scrubbed... URL: From JMcIntosh at edmundoptics.com Thu Jul 13 14:06:41 2023 From: JMcIntosh at edmundoptics.com (Jaiven McIntosh) Date: Thu, 13 Jul 2023 18:06:41 +0000 Subject: [python-win32] Getting Started Message-ID: Good Afternoon Win32 team. My name is Jaiven McIntosh. I am working for Edmund Optics this summer for an internship. My job is to create a macro that will change a specification on Solidworks prints. As we know Solidworks is VBA based for its macros. I have made a macro but I want to wrap it in python since I used Pandas to iterate through an excel sheet to find various values and stored them. How would I go about wrapping the VBA in Python? On the documentation and the website it didn't seem very obvious. Can any one point me in the right direction? -Jaiven M. -------------- next part -------------- An HTML attachment was scrubbed... URL: From niki at vintech.bg Fri Jul 14 09:57:48 2023 From: niki at vintech.bg (niki) Date: Fri, 14 Jul 2023 16:57:48 +0300 Subject: [python-win32] Getting Started In-Reply-To: References: Message-ID: On 13.07.23 ?. 21:06 ?., Jaiven McIntosh wrote: > Good Afternoon Win32 team. > > My name is Jaiven McIntosh. I am working for Edmund Optics this summer > for an internship. My job is to create a macro that will change a > specification on Solidworks prints. As we know Solidworks is VBA based > for its macros. I have made a macro but I want to wrap it in python > since I used Pandas to iterate through an excel sheet to find various > values and stored them. How would I go about wrapping the VBA in Python? > On the documentation and the website it didn?t seem very obvious. Can > any one point me in the right direction? Usually it's easier to translate VBA statements to Python statements HTH Niki