Book a Demo

Author Topic: Element Feature Link via Automation?  (Read 6308 times)

dmf

  • EA User
  • **
  • Posts: 42
  • Karma: +0/-0
    • View Profile
Element Feature Link via Automation?
« on: October 13, 2009, 03:30:50 pm »
Is it possible to determine via automation which element feature a link is to?

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Element Feature Link via Automation?
« Reply #1 on: October 13, 2009, 06:48:12 pm »
Look into the StyleEx property of a Connector.
In my example it contains:
Code: [Select]
LFEP={2C373E8B-7BB4-4de0-840B-891C5D9B3F5A}R;The GUID is the guid of an attribute.

I think there was already a forum topic about this with some interesting input from one of the Sparxians.

Geert

dmf

  • EA User
  • **
  • Posts: 42
  • Karma: +0/-0
    • View Profile
Re: Element Feature Link via Automation?
« Reply #2 on: October 13, 2009, 10:21:07 pm »
Geert,

Thanks for your quick response!  Works a treat.

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: Element Feature Link via Automation?
« Reply #3 on: October 14, 2009, 08:42:26 am »
The Sparx Team
[email protected]

dmf

  • EA User
  • **
  • Posts: 42
  • Karma: +0/-0
    • View Profile
Re: Element Feature Link via Automation?
« Reply #4 on: October 14, 2009, 08:48:54 am »
Thanks, I subsequently found that one.

Not wanting to generate a duplicate item, I had done some searching before the post, but apparently not thoroughly enough :-(

I'm sure this has been requested before, but it would reduce the number of spurious requests if Sparx Systems was to publish an all-care but no-responsibility list of these 'undocumented automation features'.

TT-Modeler

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: Element Feature Link via Automation?
« Reply #5 on: November 04, 2009, 11:11:21 am »
Hi,

I have followed the above solution but it is not quite working. The Link to Element Feature is now checked but it is not showing the attributes that are linked. Furthermore, Feature Type and Feature are not filled in when viewing the relationship via the EA GUI. Any suggestions re what I am missing?

Details:
Visual Studio 2008 / C#
Enterprise Architect Version 7.5.848
Interopt.EA v2.0.50727

Code:
EA.Connector con;

con = (EA.Connector)sourceClassElement.Connectors.AddNew("test link", "Association");
con.SupplierID = destClassElement.ElementID;
                                    
string sourceGUID = sourceAttribute.AttributeGUID.ToString();
string destGUID = destAttribute.AttributeGUID.ToString();
con.StyleEx = "LFEP=" + sourceGUID + "L;" + "LFSP=" + destGUID + "R;";
con.Update();

Thanks in advance