[python-win32] Eventhandling with Intellicad

Johannes Frank jmfrank63 at gmail.com
Wed Oct 17 16:42:42 CEST 2012


Hello everybody,

I am trying to do some eventhandling with win32com and Intellicad in python.

I did write:

import win32com.client
import win32api

import pythoncom,pywintypes
import IntelliCAD
import time
from eventhandler import *

icad_CLSID = '{77E49E57-976B-11CF-8CCB-00A0245B09EB}'

defaultNamedOptArg=pythoncom.Empty
defaultNamedNotOptArg=pythoncom.Empty
defaultUnnamedArg=pythoncom.Empty

icad_mod = win32com.client.gencache.EnsureModule(icad_CLSID, 0,1,0)

icadapp = win32com.client.Dispatch('Icad.Application')

workspace =
win32com.client.DispatchWithEvents(icadapp.Workspace,IcadWorkSpaceEvents)

doc =
win32com.client.DispatchWithEvents(workspace.ActiveDocument,IcadDocumentEvents)

newdoc = icadapp.Documents.Add()

while True:
    pythoncom.PumpMessages()
    time.sleep(2)
icadapp.Quit()

I also tried the variant defining icadapp with DispatchWithEvents , but I
do not get the workspace events except for the close event if I use the
mouse while the loop is running. Doing equivalent code in Visual Basic
works just fine. all events are catched.

The document events are catched but the workspace events are not. I tried
PumpWaitingMessages() but this jams the intellicad application, which will
only resume after the python script ended.

Does anyone have an idea to catch all events without jamming the
application.

Thank you for your support.

Kind regards

-- 
Dipl.-Ing. (FH) Johannes-Maria Frank
Bildungsberater
Königsberger-Str. 19b
76139 Karlsruhe
Tel. +49(170) 3833849
e-mail: jmfrank63 at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-win32/attachments/20121017/be350c46/attachment.html>


More information about the python-win32 mailing list