[gme-users] How to get the value of a certain attribute

Zoltan Molnar zoltan.molnar at vanderbilt.edu
Mon Apr 12 11:29:46 CDT 2004


Wrong, 
i have to correct myself: since the attribute name is part of the meta
information, you have to access it by the 
const MON::Attribute& AttributeImpl::getAttributeMeta() const; 
method.
 
The Mon::Attribute returned has methods like:
   std::string  name() const;
   std::string  displayedName() const; 
 
Br, Zoli
-----Original Message-----
From: gme-users-bounces at list.isis.vanderbilt.edu
[mailto:gme-users-bounces at list.isis.vanderbilt.edu] On Behalf Of Zoltan
Molnar
Sent: Monday, April 12, 2004 10:16 AM
To: 'A list for GME users to share thoughts and discuss bugs and fixes.'
Subject: RE: [gme-users] How to get the value of a certain attribute



Hi,
Indeed the Attribute class right now doesn't have a getName method (future
improvement), but you can inquire its the name using the com interface given
by: AttributeImpl::getAttributeI()
like:
 
std::string getAttributeName( Attribute * myattribute )
{
  CComBSTR bstrName;
  COMTHROW( myattribute->getAttributeI()->get_Name( &bstrName ) );
  return Util::Copy( bstrName );
}
 
Br, Zoli

-----Original Message-----
From: gme-users-bounces at list.isis.vanderbilt.edu
[mailto:gme-users-bounces at list.isis.vanderbilt.edu] On Behalf Of Zhimin He
Sent: Sunday, April 11, 2004 1:35 PM
To: gme-users at list.isis.vanderbilt.edu
Subject: [gme-users] How to get the value of a certain attribute



I'm using BON2 that comes with GME 4.3.17. I can get the whole set of
attributes with Model->getAttributes. When I tried to iterate through the
set, I couldn't find the api to get an attribute's name. Is there something
similar to attribute->getname()?

Thx

Zhimin 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://list.isis.vanderbilt.edu/pipermail/gme-users/attachments/20040412/09880525/attachment.htm


More information about the gme-users mailing list