Wxpython and external library

Wxpython and external library

Hi I’m trying to use a library for viewing AutoCad dwg-files in a wxpython
application. I have seen example code in VB (and Delphi), but I can not figure
out how to do this in python / wxpython.

My code looks like this

import win32com.client

odaView = win32com.client.gencache.EnsureDispatch("VIEWXLib.OdaViewer")
odaHost= win32com.client.gencache.EnsureDispatch("DWGdirectX.OdaHostApp")
odaApp = odaHost.Application
odaDoc = odaHost.Application.Documents.Open('c:/temp/test.dwg')
oDevice = odaView.DeviceManager().NewDevice(r'C:\Program Files\OpenDWG
Alliance\DWGdirectX\WinGDI.gs')
oDevice.SetupActiveLayoutViews(odaDoc.Database)

I’m not sure how the mechanisms of this, but I one of several questions is how
to place the odevice-object in a wxpython frame.
Hope someone could give some hint on this one.

Thanks!

Regards Olav

···

-------------------------------------------------------------------------
Start.no tilbyr nå raskere bredbånd til lavere pris.
Sjekk http://www.start.no/bredband/ for mer informasjon

Could you post a link to the VB/Delphi examples?
Maybe someone recognizes the approch and can adapt it to Python.

OTOH, http://www.win32com.de/ looks like a place to start
looking/asking for help.

Harald Stürzebecher

···

2005/11/22, Olav <nekiv@start.no>:

Wxpython and external library

Hi I'm trying to use a library for viewing AutoCad dwg-files in a wxpython
application. I have seen example code in VB (and Delphi), but I can not figure
out how to do this in python / wxpython.

My code looks like this

import win32com.client

odaView = win32com.client.gencache.EnsureDispatch("VIEWXLib.OdaViewer")
odaHost= win32com.client.gencache.EnsureDispatch("DWGdirectX.OdaHostApp")
odaApp = odaHost.Application
odaDoc = odaHost.Application.Documents.Open('c:/temp/test.dwg')
oDevice = odaView.DeviceManager().NewDevice(r'C:\Program Files\OpenDWG
Alliance\DWGdirectX\WinGDI.gs')
oDevice.SetupActiveLayoutViews(odaDoc.Database)

I'm not sure how the mechanisms of this, but I one of several questions is how
to place the odevice-object in a wxpython frame.
Hope someone could give some hint on this one.