Author Topic: How to get a Element Collection from an Element id  (Read 6900 times)

albertpravin

  • EA Novice
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
How to get a Element Collection from an Element id
« on: April 20, 2004, 11:49:24 pm »
Hi ,

i am a newbie to Automation .

I am Dumping all packages and Elements in a Listbox.
If i Choose a Element from the list box ,
i need to drill down only on that element, and get all methods and attributes in that element.

can anyone help me .

====================================
-- element_id_ i get from the list box
-- element_name_  one of the object in a element collection
-- idx_ element collection sequence.

EA.Element Element = (EA.Element)m_Repository.GetElementByID(Convert.ToInt16(element_id_));
                 

                       EA.Package Package = (EA.Package)m_Repository.GetPackageByID(Element.PackageID);
                             Element = (EA.Element)Element.Elements.GetByName(element_name_);
                       MessageBox.Show(Element.Name.ToString());
                       
                       //Element = (EA.Element)Package.Element.Elements.GetByName(element_name_.ToString());
                       eDumpMethods(Indent, (EA.Element)Package.Elements.GetAt(Convert.ToInt16(idx_)));


Thanks

Albert.