[python-win32] COM - respond to other application's event
mhammond at skippinet.com.au
Thu Nov 10 06:57:27 CET 2005
Check out DispatchWithEvents
>>> import win32com.client
From: python-win32-bounces at python.org
[mailto:python-win32-bounces at python.org]On Behalf Of wccppp
Sent: Thursday, 10 November 2005 5:04 AM
To: python-win32 at python.org
Subject: [python-win32] COM - respond to other application's event
I'm a beginner learning Python. Trying to automate AutoCAD. What I
wanted to know is how to receive event fired by the AutoCAD application.
When a drawing opening process is done, the application will fire an event
EndOpen. In VBA, I know how to catch and respond to this event. But do not
know how to accomplish it with Python.
acad = win32com.client.Dispatch("AutoCAD.Application")
acad.Visible = True
acad.WindowState = 3
doc = acad.Documents.Open(r"C:\Drawings\test.dwg")
print ("Drawing opened.")
Thanks for your time and help,
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-win32