1

In my scripts I used to connect to AutoCAD via Python win32com library:

app = win32com.client.Dispatch("AutoCAD.Application")
aDoc = app.ActiveDocument
mSp = aDoc.ModelSpace

It mostly works well, but sometimes when the AutoCAD is properly opened and Model Space is active this code can't find launched AutoCAD in the system, and launches new copy of AutoCAD instead. The same may happen when I try to get MS Word documents in this way. Is there any explanation for such an odd behavior and is it possible to fix it?

Tonechas
  • 13,398
  • 16
  • 46
  • 80
Sib
  • 404
  • 4
  • 16
  • https://stackoverflow.com/questions/7787120/python-check-if-a-process-is-running-or-not – JDunken Jan 02 '20 at 15:56
  • Yes, I see. Well, it's not an issue to detect programmatically if an instance of program is running, just I wonder why absolutely the same command in win32com behaves so different, maybe there are some ways to change it. – Sib Jan 03 '20 at 12:11

0 Answers0