Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: furman76 on September 30, 2011, 10:18:04 pm

Title: How to set a stereotype?
Post by: furman76 on September 30, 2011, 10:18:04 pm
Hi,

        Attribute attr = parent.GetAttributes().AddNew(name, type);
        attr.SetStereotype("My Attribute");
        attr.Update();

works, and "My Attribute" is displayed on the class, but it is not linked in any way to the "My Attribute" stereotype defined in my UML Profile. I still have to manually update stereotype for every attribute imported. Is there any way to set specific stereotype through the API? Also, is there a way to invoke tagged value synchronization for the stereotypes defined in the UML profile?
Title: Re: How to set a stereotype?
Post by: qwerty on October 01, 2011, 12:38:36 am
Not sure if this works at all: try to qualify the stereotype with your MDG (like MYMDG::My Stereotype).

q.
Title: Re: How to set a stereotype?
Post by: furman76 on October 01, 2011, 01:16:26 am
Tried it. Also tried to specify stereotype GUID instead of name. It just treats it as string. Looks like a gap.
Title: Re: How to set a stereotype?
Post by: qwerty on October 03, 2011, 03:56:25 am
While working on my new ebook I once again stumbled over this. According to this thread (http://www.sparxsystems.com/cgi-bin/yabb/YaBB.cgi?num=1308572379/0#0) the creation does work. I tried this with my own profile but failed. Probably there's a bug in EA. I'll investigate a bit more.

q.