Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: Robert Sheridan on December 03, 2016, 02:32:09 am

Title: Can you get the profile used to stereotype an element
Post by: Robert Sheridan on December 03, 2016, 02:32:09 am
Hello all,
I am wanting to use the API to extract the profile used to set the stereotype for an element.  I can get the stereotype but have not found anything in the API that gives me the profile, does anyone know how to do this.

Thanks
Title: Re: Can you get the profile used to stereotype an element
Post by: qwerty on December 03, 2016, 03:48:47 am
AFAIK there is nothing in the API to give you that information. What you need to do is to query t_xref:
Code: [Select]
SELECT description FROM t_xref WHERE client=<ea_guid of element>That will return something like
Code: [Select]
@STEREO;Name=ArchiMate_Junction;FQName=Archimate2::ArchiMate_Junction;@ENDSTEREO;
Use Repository.SQLQuery and parse the returned XML string.

q.
Title: Re: Can you get the profile used to stereotype an element
Post by: Robert Sheridan on December 03, 2016, 04:14:15 am
Thanks Qwerty, have been reading your book and that was where it was leading me.
Free uptick: the books have been very useful, very good investment.
Title: Re: Can you get the profile used to stereotype an element
Post by: Eve on December 05, 2016, 08:16:14 am
Element.FQStereotype (http://sparxsystems.com/enterprise_architect_user_guide/13.0/automation/element2.html)
Title: Re: Can you get the profile used to stereotype an element
Post by: qwerty on December 05, 2016, 05:50:01 pm
Doh! I just testet StereotypeEx  :-[

q.
Title: Re: Can you get the profile used to stereotype an element
Post by: Robert Sheridan on December 05, 2016, 09:20:42 pm
Thanks Simon, did not spot that this had been added in to the API since I last did this (reusing old code).
Robert