Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started 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
-
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
-
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
-
peuhhhh,
It might be faster if you show us your code so we can point out what is going wrong.
Geert
-
ok here we go . First i created a connector between a GUIElement and a Class object.
then i tried both of these two lines :
c.StyleEx = "LFSP=" + attribute.AttributeGUID + "L;";
c.StyleEx = "LFEP=" + clientElement.ElementGUID + "R;" + "LFSP=" + attribute.AttributeGUID + "L;";
then
c.update() ;
my connector is well created but the 'link to element feature' doesnt show on the diagram.
-
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
-
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 ?
-
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
-
ok thanks Geert i'll investigate
-
I finally found out how to script the 'link to element feature' command for my case at least.
my piece of code is simply :
c.StyleEx = "LFEP=" + attribute.AttributeGUID + "L;";