Ok, that's "interesting". I have a VMWare image that I have available
for testing installations so it is a clean machine to start with. I
installed AutoCAD 2004 and Python 2.5.2 and comtypes 0.5.1 on there
and all works as expected. Installing and uninstalling comtypes on my
personal machine makes no difference. I suspect the problem is my
installation of AutoPLANT which sits on top of AutoCAD -- but pywin32
seems to have no difficulty with it and I really need that for my work
so I can't simply uninstall it. Why AutoPLANT would cause
difficulties, though, I'm not sure. There seemed to be some difference
in how the generated class was built so I copied the generated file
from the working machine to my own machine but that made no
difference. It seems like what is happening is that
app.ActiveDocument.ModelSpace is actually returning app.ActiveDocument
for some reason so its obvious then why no such interface is
supported. But why the property for ModelSpace is returning the
document I have no clue. Any further suggestions on how to figure this
out?

Anthony

On Thu, Aug 21, 2008 at 10:09 AM, Ed Blake <[EMAIL PROTECTED]> wrote:
> [oops, darn reply address thing bit me again, sorry Anthony]
>
> That's funny, my old laptop actually has vanilla 2004 installed!  I just 
> installed comtypes 0.5.1 and tested it out - everything works normally?
>
> I think this indicates a deeper flaw at work.  I would suggest that next you 
> try re-installing (a fresh download?) of comtypes.  If that doesn't help you 
> may need to run the repair utilities that come on the Autocad CD.
>
> My next question would be if you had any strange applications loaded into 
> Autocad?  I don't know what side effects you might suffer if you have a vba 
> script running in the background, or if you have some strange arx loaded.  
> You can find what is loaded by picking the Tools > Autolisp > Load... menu 
> entry and looking in the Loaded Applications box near the bottom of the 
> resulting dialog. (This list all applications, not just lisps.  In later 
> versions they moved this dialog to the "Load Applications" menu entry.)  Look 
> for anything that doesn't start with either "ac" or "acet".  I have a few 
> misc. arx files loaded at the bottom of the list, but they all come from my 
> Autocad install folder.
>
> I think there are a few COM improvements in Acad'05, but Acad'04 should work 
> just fine...
>
> Ed Blake
>
>
> --- On Wed, 8/20/08, Anthony Tuininga <[EMAIL PROTECTED]> wrote:
>
>> From: Anthony Tuininga <[EMAIL PROTECTED]>
>> Subject: Re: [comtypes-users] No such interface supported?
>> To: [EMAIL PROTECTED], comtypes-users@lists.sourceforge.net
>> Date: Wednesday, August 20, 2008, 12:42 PM
>> Thanks for the suggestion. I tried clearing the gen
>> directory in
>> site-packages/comtypes and no dice. The code in question
>> that I am
>> using is the sample code from the web site but I'll
>> post it here again
>> just for clarity:
>>
>> app =
>> comtypes.client.GetActiveObject("AutoCAD.Application")
>> modelSpace = app.ActiveDocument.ModelSpace
>>
>> This is using AutoCAD 2004. I don't have a copy of
>> AutoCAD 2008 to try
>> currently. Do you have a copy of AutoCAD 2004 that you
>> could try?
>>
>> Thanks for your help so far.
>>
>> Anthony
>>
>> On Wed, Aug 20, 2008 at 10:20 AM, Ed Blake
>> <[EMAIL PROTECTED]> wrote:
>> >
>> > I've been using comtypes 0.3.3 because of issues
>> with recent versions (and Autocad/Microstation) and because
>> comtypes development has been fairly rapid (waiting for that
>> next cool version).  Just now I installed 0.5.1 (and let it
>> empty my comtypes wrapper cache) and messed with Autocad a
>> little.  Everything seems to work fine here using Autocad
>> 2008 (civil 3d pretending to be land-desktop configured to
>> act like plain old Autocad ;)
>> >
>> > My sugestion is to delete the contents of your gen
>> directory in site-packages\comtypes and regenerate.  If
>> that doesn't work post some code and we'll see if
>> you've done anything strange!
>> >
>> > Ed Blake
>> >
>> > --- On Tue, 8/19/08, Anthony Tuininga
>> <[EMAIL PROTECTED]> wrote:
>> >
>> >> From: Anthony Tuininga
>> <[EMAIL PROTECTED]>
>> >> Subject: [comtypes-users] No such interface
>> supported?
>> >> To: comtypes-users@lists.sourceforge.net
>> >> Date: Tuesday, August 19, 2008, 2:15 PM
>> >> Hi,
>> >>
>> >> I have successfully used pywin32 for a while now
>> for doing
>> >> COM related
>> >> stuff but ran into a problem with it using AutoCAD
>> to
>> >> create points
>> >> and lines as appears to be well known given the
>> >> documentation for
>> >> comtypes. So I downloaded comtypes and installed
>> it (0.5.1
>> >> and later
>> >> on SVN trunk) but immediately ran into a problem
>> running
>> >> the sample
>> >> code. Specifically, the instance is created fine
>> and
>> >> app.ActiveDocument returns a value but
>> >> app.ActiveDocument.ModelSpace
>> >> yields "no such interface supported" and
>> so does
>> >> anything else on
>> >> app.ActiveDocument from what I can tell. Is there
>> something
>> >> obvious
>> >> that I am missing? A Google search doesn't
>> suggest as
>> >> much but maybe
>> >> I'm using the wrong terms. :-) Any help
>> appreciated.
>> >> Thanks.
>> >>
>> >> Anthony
>> >>
>> >>
>> -------------------------------------------------------------------------
>> >> This SF.Net email is sponsored by the Moblin Your
>> Move
>> >> Developer's challenge
>> >> Build the coolest Linux based applications with
>> Moblin SDK
>> >> & win great prizes
>> >> Grand prize is a trip for two to an Open Source
>> event
>> >> anywhere in the world
>> >>
>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>> >> _______________________________________________
>> >> comtypes-users mailing list
>> >> comtypes-users@lists.sourceforge.net
>> >>
>> https://lists.sourceforge.net/lists/listinfo/comtypes-users
>> >
>> >
>> -------------------------------------------------------------------------
>> > This SF.Net email is sponsored by the Moblin Your Move
>> Developer's challenge
>> > Build the coolest Linux based applications with Moblin
>> SDK & win great prizes
>> > Grand prize is a trip for two to an Open Source event
>> anywhere in the world
>> >
>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>> > _______________________________________________
>> > comtypes-users mailing list
>> > comtypes-users@lists.sourceforge.net
>> >
>> https://lists.sourceforge.net/lists/listinfo/comtypes-users
>> >
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> comtypes-users mailing list
> comtypes-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/comtypes-users
>

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
comtypes-users mailing list
comtypes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/comtypes-users

Reply via email to