win32com problem

Steve Holden steve at holdenweb.com
Tue Oct 24 21:51:39 EDT 2006


cfriedalek at gmail.com wrote:
> I'm interacting with a third party application using python and com.
> However having problems and don't know what to look at next to resolve
> the issue.
> 
> The app. can be driven by VBS. The following VBS code works:
> 
> Set Synergy = CreateObject("synergy.Synergy")
> Synergy.OpenProject "D:/temp/project.mpi"
> Synergy.Project.OpenItemByName "test_bar_3d_6l_pc1", "Study"
> Set Tet = Synergy.StudyDoc.GetFirstTet()
> While Not Tet Is Nothing
>   Str = Tet.ConvertToString() + " "
>   Set Tet = Synergy.StudyDoc.GetNextTet(Tet)
>   MsgBox Str
> WEnd
> 
> This prints "TE1" "TE2" etc
> 
> 
> The "same" code in python returns <COMObject <unknown>> with each call
> to the GetNextTet method.
> 
> import win32com.client
> from win32com.client import Dispatch
> Synergy = win32com.client.Dispatch("synergy.Synergy")
> Synergy.OpenProject("D:/temp/project.mpi")
> Synergy.Project.OpenItemByName("test_bar_3d_6l_pc1", "Study")
> tet = Synergy.StudyDoc.GetFirstTet

tet = Synergy.StudyDoc.GetFirstTet(), perhaps?

> while tet:
>     print str(tet)
>     tet = Synergy.StudyDoc.GetNextTet(tet)
> 
> Any clues on what I'm doing wrong, or how to investigate whether there
> is a bug in win32com or in the third party apps com implementation.
> 

regards
  Steve
-- 
Steve Holden       +44 150 684 7255  +1 800 494 3119
Holden Web LLC/Ltd          http://www.holdenweb.com
Skype: holdenweb       http://holdenweb.blogspot.com
Recent Ramblings     http://del.icio.us/steve.holden




More information about the Python-list mailing list