Get ClassID of different versions of program with same ProgID

ilocke ivanlocke at mail.com
Fri Jun 1 18:11:45 EDT 2007


Hello,

I am new to Python and COM, but both seem very useful for automation
as AutoCAD, ArcGIS, and my gps software all have COM interfaces and
ArcGIS actually uses python scripts.

My trouble is that I am running two versions of AutoCAD (14 and 2004).
The problem is that both have the same ProgID.

When I use:
acad=win32com.client.Dispatch('AutoCAD.Application")
with no AutoCAD open, I get whichever version is set as default (I
tested switching my default).
With an AutoCAD session open, it will find the open session regardless
of version.

How can I get the ClassID of the different versions? I can connect to
them, is there some:
acad=win32com.client.Dispatch('AutoCAD.Application")
print acad.ClsID   # Or something like that?

I have searched and searched and cannot find such.
I have also tried looking at the makepy, but trying the id numbers I
see there I just get errors:
'Class not registered'

Oh, one note, I don't have access to the registry (at least regedit),
so can't look up the ID's there. I tried pythoncom.GetClassFile, but
get error:
'Moniker cannot open file'
I am assuming because I don't have access to registry.

Thanks for the help,
Ivan




More information about the Python-list mailing list