Kelie wrote > >Hello, > >I tried using comtypes to change the colors of all objects in the ModelSpace of >a drawing and got some interesting (at least to me) results. First of all, the >speed of Python code is much slower than Autolisp/VisualLisp (a programming >language built into AutoCAD) code. Second of all, I'm puzzled by the >significant >differences among different Python methods.
I would guess that the main difference in speed is actually due to out of process COM rather than the difference between Autolisp/Python. I would suggest trying a simple test with Word for example, automate AutoCAD through the VBA in word - and see if it is much faster than Python. > >1. How can I improve the performance of Python code here? >2. I suppose comtypes uses early-bound once the module(s) is/are generated in >the comtypes/gen directory? Is this assumption correct? If not, how can I use >early-bound with comtypes? Would that improve the performance? >3. Why would the methods in 2nd and 3rd testing be 5 times slower than the 1st >one? > I have no idea why these take longer. If you change the order of the 3 tests - is it still the xrange that is fastest? >Btw, from my testing, the performance of win32com is about the same as >comtypes. > >Thanks very much for your input! > Hope this helps to some extent Mark > > ------------------------------------------------------------------------- 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