[gme-users] MGAMeta: UsingDefinedFCOs
larry.howard at vanderbilt.edu
Sun Mar 2 08:46:02 CST 2008
In general, casting is a good first step when you run into this kind
of issue. No guarantees, just a measure to ensure a particular
interpretation of a returned COM pointer type.
meta = win32com.client.gencache.GetModuleForProgID("Mga.MgaMetaFCOs")
rFCOs = project.RootMeta.RootFolder.DefinedFCOs
for rFCO in rFCOs:
works fine for me.
In searching over a large body of our Python code for GME, I find a
significant amount of casting of Meta-related COM pointers. This is
merely an observation from experience, but it bears out the above
Larry Howard, Sr. Research Scientist
Institute for Software Integrated Systems, Vanderbilt University
On Mar 2, 2008, at 5:46 AM, Simon Görke wrote:
> Hello everybody,
> I have a problem accessing the FCOs of my Meta model from an
> written in Python / COM.
> While a simple
> print project.RootMeta.RootFolder.DefinedFCOByName("MetaEntityName",
> works without problems, using
> rFCOs = project.RootMeta.RootFolder.DefinedFCOs
> print rFCOs.Count
> for rFCO in rFCOs:
> print rFCO.Name
> is not successful. The number of meta entities returned by the
> seems correct, however I am not able to actually access the FCOs
> (Python gives me "AttributeError: <unknown>.Name").
> Within the interpreter, I have to access ALL Meta Entities without
> their names, so using the "DefinedFCOs" method seemed to be a good
> idea to
> BTW: Using MGA Collections in general does not seem to be part of the
> problem, as the follwing code snippet is working:
> FCOs = project.RootFolder.ChildFCOs
> for FCO in FCOs:
> print FCO.Name
> I really do not know how to go on on and wheather this issue results
> lack of understanding on my side or even a problem in the GME /
> Python COM
> Any advice is highly appreciated!
> gme-users mailing list
> gme-users at list.isis.vanderbilt.edu
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 2698 bytes
Desc: not available
Url : http://list.isis.vanderbilt.edu/pipermail/gme-users/attachments/20080302/61b3adb8/attachment.bin
More information about the gme-users