Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: sandeep bhat on November 15, 2014, 01:01:15 am

Title: More info on GetElementsByQuery
Post by: sandeep bhat on November 15, 2014, 01:01:15 am
Hi,
There is this method from the Repository Class GetElementsByQuery (string QueryName, string SearchTerm).

i want to find an Element object with its name 'sint16'.
By default this query- GetElementsByQuery ("Simple", "sint16") returns a collection witth the string sint16 contained in either name or notes. I want to filter this query only if it matches the name.
Title: Re: More info on GetElementsByQuery
Post by: qwerty on November 15, 2014, 06:40:22 am
You could write your own SQL search:
Code: [Select]
SELECT t_object.ea_guid AS CLASSGUID, t_object.Object_Type AS CLASSTYPE,t_object.Name FROM t_object WHERE Name = "<Search Term>"
q.
Title: Re: More info on GetElementsByQuery
Post by: sandeep bhat on November 17, 2014, 06:59:16 pm
Thanks q, by  the way is the Enterprise Architect Database accessible? Any location where it is saved?
Title: Re: More info on GetElementsByQuery
Post by: qwerty on November 17, 2014, 07:47:27 pm
Yes. Use Repository.SQLQuery("SELECT...") (see the help). You might also be interested in my Inside book (link below).

q.
Title: Re: More info on GetElementsByQuery
Post by: sandeep bhat on November 17, 2014, 08:52:03 pm
Yes, i will definitely have a look at it. Thanks again q.