Author Topic: AutomationInterface: retrieveAllElements()  (Read 2342 times)

Marco Zapletal

  • EA Novice
  • *
  • Posts: 16
  • Karma: +0/-0
    • View Profile
AutomationInterface: retrieveAllElements()
« on: August 01, 2005, 05:36:38 am »
hello,

we are currently creating an addin for EA and thus heavily using the automation interface. if we want to search the whole model for a certain criteria, we have to recursivly go through the model each time.
so how about a function returning all the elements in a flat collection?
example:

public EA.Collection getAllElements()  -> returning all elements in a model (repository)

the following convenience function would also be cool:

public EA.Collection getAllElements(EA.Package start) -> returning all elements of a package and its subpackages, starting from the given package.


thanks for your great efforts...

regards,
marco

thomaskilian

  • Guest
Re: AutomationInterface: retrieveAllElements()
« Reply #1 on: August 01, 2005, 06:41:56 am »
Why not implementing that class by yourself? Just populate it once you open the repository.

Marco Zapletal

  • EA Novice
  • *
  • Posts: 16
  • Karma: +0/-0
    • View Profile
Re: AutomationInterface: retrieveAllElements()
« Reply #2 on: August 01, 2005, 06:51:39 am »
thats not the problem, but again i can only traverse the repository recursivly with the automationinterface, which takes quite a long time on a huge model.

since EA uses an access db, i assume that there exists something like an element table. thus a query like  
Code: [Select]
SELECT * FROM elements and populating a collection with the returned stuff be several times faster.

and because the repository changes during modeling, a one time traversion of the model at startup won't be of great help ;)