Book a Demo

Author Topic: Result of a model search  (Read 4792 times)

Knut Paulsen

  • EA User
  • **
  • Posts: 82
  • Karma: +1/-0
    • View Profile
Result of a model search
« on: October 19, 2016, 11:42:47 pm »
Hi guys,

How do I get hold of the result of a model search? I want to do stuff to the elements I find.

The repository has a RunModelSearch method that displays the result in EA.
The Project Class has a RunModelSearch where you can select to not display result in EA. If I select not to, where does the result go?

Cheers Knut

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Result of a model search
« Reply #1 on: October 19, 2016, 11:48:45 pm »
Knut,

I think RunModelSearch only show the results in EA and never returns anything.

What you can do is either use
GetElementsByQuery (string QueryName, string SearchTerm)
or use
GetElementSet (string IDList, long Options)
The latter allows you to pass an SQL search query returning elementID's, if you use "2" as the option parameter.

Geert

Knut Paulsen

  • EA User
  • **
  • Posts: 82
  • Karma: +1/-0
    • View Profile
Re: Result of a model search
« Reply #2 on: October 20, 2016, 06:22:07 am »
Thanks Geert,

Exactly what I was looking for :-)

How did I not see that one?

cheers
Knut