<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.2769" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=934395205-10112005><FONT face=Arial color=#0000ff size=2>Check 
out DispatchWithEvents</FONT></SPAN></DIV>
<DIV><SPAN class=934395205-10112005><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=934395205-10112005><FONT face=Arial color=#0000ff 
size=2>&gt;&gt;&gt; import win32com.client</FONT></SPAN></DIV>
<DIV><SPAN class=934395205-10112005><FONT face=Arial color=#0000ff 
size=2>&gt;&gt;&gt; help(win32com.client.DispatchWithEvents)</FONT></SPAN></DIV>
<DIV><SPAN class=934395205-10112005><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=934395205-10112005><FONT face=Arial color=#0000ff 
size=2>Mark</FONT></SPAN></DIV>
<BLOCKQUOTE 
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid">
  <DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma 
  size=2>-----Original Message-----<BR><B>From:</B> 
  python-win32-bounces@python.org [mailto:python-win32-bounces@python.org]<B>On 
  Behalf Of </B>wccppp<BR><B>Sent:</B> Thursday, 10 November 2005 5:04 
  AM<BR><B>To:</B> python-win32@python.org<BR><B>Subject:</B> [python-win32] COM 
  - respond to other application's event<BR><BR></FONT></DIV>Hello 
  group,<BR><BR>I'm a beginner learning Python.&nbsp; Trying to automate 
  AutoCAD.&nbsp; What I wanted to know is how to receive event fired by the 
  AutoCAD application.&nbsp; When a drawing opening process is done, the 
  application will fire an event EndOpen.&nbsp; In VBA, I know how to catch and 
  respond to this event.&nbsp; But do not know how to accomplish it with 
  Python.&nbsp; <BR><BR><A 
  onclick="return top.js.OpenExtLink(window,event,this)" 
  href="mailto:python-win32@python.org">import win32com.client<BR>acad = 
  win32com.client.Dispatch("AutoCAD.Application")<BR>acad.Visible = 
  True<BR>acad.WindowState = 3<BR>doc = 
  acad.Documents.Open(r"C:\Drawings\test.dwg")<BR>print ("Drawing 
  opened.")<BR><BR></A>Thanks for your time and help,<BR clear=all><BR>-- 
  <BR><BR>Regards,<BR>- wcc<BR><BR></BLOCKQUOTE></BODY></HTML>