Book a Demo

Author Topic: Link to Element Feature  (Read 5662 times)

peuhhhh

  • EA User
  • **
  • Posts: 31
  • Karma: +0/-0
    • View Profile
Link to Element Feature
« 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

Aaron B

  • EA Administrator
  • EA User
  • *****
  • Posts: 941
  • Karma: +18/-0
    • View Profile

peuhhhh

  • EA User
  • **
  • Posts: 31
  • Karma: +0/-0
    • View Profile
Re: Link to Element Feature
« Reply #2 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

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Link to Element Feature
« Reply #3 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

peuhhhh

  • EA User
  • **
  • Posts: 31
  • Karma: +0/-0
    • View Profile
Re: Link to Element Feature
« Reply #4 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.





Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Link to Element Feature
« Reply #5 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

peuhhhh

  • EA User
  • **
  • Posts: 31
  • Karma: +0/-0
    • View Profile
Re: Link to Element Feature
« Reply #6 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 ?

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Link to Element Feature
« Reply #7 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

peuhhhh

  • EA User
  • **
  • Posts: 31
  • Karma: +0/-0
    • View Profile
Re: Link to Element Feature
« Reply #8 on: June 29, 2010, 11:56:49 pm »
ok thanks Geert i'll investigate

peuhhhh

  • EA User
  • **
  • Posts: 31
  • Karma: +0/-0
    • View Profile
Re: Link to Element Feature
« Reply #9 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;";