Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: peuhhhh on June 28, 2010, 11:47:07 pm

Title: Link to Element Feature
Post by: peuhhhh on June 28, 2010, 11:47:07 pm
Hello,
 i wondered if anyone found out how to script the same effect as the 'Link to element feature' command ?
i did not see any info about it using the forum and browsing the EA SDK.

thanks,
peuhhh
Title: Re: Link to Element Feature
Post by: Aaron B on June 29, 2010, 07:43:43 am
See the following threads:
http://www.sparxsystems.com/cgi-bin/yabb/YaBB.cgi?num=1255408250/1#1
http://www.sparxsystems.com/cgi-bin/yabb/YaBB.cgi?num=1251095150/2#2
Title: Re: Link to Element Feature
Post by: peuhhhh on June 29, 2010, 10:42:30 pm
thanks for the answer.
I tried what the people says about, but it wont works ; i'd like to see a code example if anyone succeeded .

thanks in advance
peuhhh
Title: Re: Link to Element Feature
Post by: Geert Bellekens on June 29, 2010, 11:11:07 pm
peuhhhh,

It might be faster if you show us your code so we can point out what is going wrong.

Geert
Title: Re: Link to Element Feature
Post by: peuhhhh on June 29, 2010, 11:18:04 pm
ok here we go . First i created a connector between a GUIElement and a Class object.
then i tried both of these two lines :


Code: [Select]
c.StyleEx = "LFSP=" + attribute.AttributeGUID + "L;";


Code: [Select]
c.StyleEx = "LFEP=" + clientElement.ElementGUID + "R;" + "LFSP=" + attribute.AttributeGUID + "L;";
then

Code: [Select]
c.update() ;
my connector is well created but the 'link to element feature' doesnt show on the diagram.




Title: Re: Link to Element Feature
Post by: Geert Bellekens on June 29, 2010, 11:27:27 pm
Look closely at the data created by EA itself when it stores a "link to element feature".
I think the ID that is put into that field is only the first part of the attribute GUID, not the whole thing.

Geert
Title: Re: Link to Element Feature
Post by: peuhhhh on June 29, 2010, 11:29:44 pm
ok Geert, but i still have the problems i don't have access to the database.
Do you know any other way to know what EA stores ?
Title: Re: Link to Element Feature
Post by: Geert Bellekens on June 29, 2010, 11:48:47 pm
peuhhhh,

If you have access to EA you (by default) have access to the database.
Use Repository.SQLQuery if you can't execute queries otherwise.

Geert
Title: Re: Link to Element Feature
Post by: peuhhhh on June 29, 2010, 11:56:49 pm
ok thanks Geert i'll investigate
Title: Re: Link to Element Feature
Post by: peuhhhh on June 30, 2010, 12:53:15 am
I finally found out how to script the 'link to element feature' command for my case at least.

my piece of code is simply :
Code: [Select]
c.StyleEx = "LFEP=" + attribute.AttributeGUID + "L;";