Book a Demo

Author Topic: Change Link Style programatically  (Read 5555 times)

William McKenzie

  • EA User
  • **
  • Posts: 61
  • Karma: +0/-0
    • View Profile
Change Link Style programatically
« on: June 06, 2012, 11:07:40 am »
How does one change the Line Style of a connector using the automation interface? For instance, I would like to walk through my diagram and change all of the links to 'Direct' routing (the equivalent of Ctrl+Shift+D). It seems like there are several possible related properties (like Style, Path,  & Geometry), but there is no clear documentation on how to use these properties to select a particular element to element routing style.

William McKenzie

  • EA User
  • **
  • Posts: 61
  • Karma: +0/-0
    • View Profile
Re: Change Link Style programatically
« Reply #1 on: June 06, 2012, 11:25:47 am »
OK, I did a little dump of those properties, and this is what I get:

Path:
624:-1024;      

Geometry:
SX=0;SY=0;EX=0;EY=0;EDGE=1;$LLB=;LLT=;LMT=;LMB=CX=164:CY=14:OX=0:OY=0:HDN=0:BLD=0:ITA=0:UND=0:CLR=-1:ALN=0:DIR=0:ROT=0;LRT=;LRB=;IRHS=;ILHS=;      

Style:
Mode=3;EOID=00ADA3AA;SOID=59EEEB46;Color=-1;LWidth=0;TREE=OR;      

Maybe it's the 'Mode' part of the style? In which case, does someone know the enumeration for those values?

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Change Link Style programatically
« Reply #2 on: June 06, 2012, 04:16:45 pm »
Hi William,

It might indeed have something to do with the mode, and maybe also with the TREE=OR part.
Figuring this out shouldn't be too hard should it?
Just make a link in each style and inspect the t_diagramlinks table.

Searching this forum for "link style" also shows some interesting posts.

Geert

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Change Link Style programatically
« Reply #3 on: June 06, 2012, 04:18:28 pm »
And even more interesting: an open source add-in that changes the link styles:
http://eautils.codeplex.com/

Geert

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Change Link Style programatically
« Reply #4 on: June 06, 2012, 05:19:41 pm »
Line Stye: TREE=OR; means orthogonal rounded; OS = Ort. square and so on.

q.

William McKenzie

  • EA User
  • **
  • Posts: 61
  • Karma: +0/-0
    • View Profile
Re: Change Link Style programatically
« Reply #5 on: June 07, 2012, 04:07:24 am »
Thanks, all. Those hints will get me going.