Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: Aleksandar on September 30, 2013, 11:45:08 pm
-
Hi,
After adding elements to a diagram through the automation interface (which are connected with nesting connectors), by using
project.LayoutDiagram(diagramEA.GetDiagramGUID(), n)
I can layout the diagram in hierarchical order. The value for n doesn't seem to influence the layout.
However I cannot find a way to call the auto route for the connectors through the automation interface. Is that possible?
And one more question... I know that there is a problem with the port positioning (which doesn't work), so I'm using sql updates for that, but is it somehow possible to call auto route for the connectors connected to ports?
Thanks,
-
However I cannot find a way to call the auto route for the connectors through the automation interface. Is that possible?
I don't understand what you want :-? Do you want to set auto-route for single/all connectors? That's a property in t_connectors. Do you have my Inside book?
And one more question... I know that there is a problem with the port positioning (which doesn't work), so I'm using sql updates for that, but is it somehow possible to call auto route for the connectors connected to ports?
No. EA does not layout port connectors. I once wrote a Perl script to assist with that which I had publish on the community site. It has a bit of fuzzy logic which aligns opposing ports and so on.
q.
-
Yes, I have the book. I want to call auto route on all connectors. I'm first adding all the elements to the diagram, and then i call
project.LayoutDiagram(diagramEA.GetDiagramGUID(), n)
from the projectInterface so they are displayed in hierarchical order similar to the Diagraph option for layout, so after that because some connectors are displayed over other elements, I'm trying to call the Auto route (which is one of the options for layout of a diagram...like Circle, Diagraph or Box...)
-
Ah. I have not published that version yet. You need to set the CSV tag MODE=3; in t_diagramlinks.geometry. That will let EA render auto-route. I'll publish the new chapter 2.5 about t_diagramlinks the next days.
q.
-
Yes, I have the book. I want to call auto route on all connectors. I'm first adding all the elements to the diagram, and then i call
project.LayoutDiagram(diagramEA.GetDiagramGUID(), n)
from the projectInterface so they are displayed in hierarchical order similar to the Diagraph option for layout, so after that because some connectors are displayed over other elements, I'm trying to call the Auto route (which is one of the options for layout of a diagram...like Circle, Diagraph or Box...)
I wrote a script to allow converting all connectors on a diagram to each style. You just have to switch out the setting at the beginning to set it up for how you want to use it. You can make multiple copies of it to switch between the multiple styles. http://www.sparxsystems.com/cgi-bin/yabb/YaBB.cgi?num=1377757601
The way you change between them isn't very straight forward.
-
Thanks for the advice qwerty and rothnic. By setting the CSV MODE =2 for the style for each individual connector, I can set them to auto-route style. However the lines still cross other elements.
What I was looking for was a way to call this what is displayed in the link, but from the automation interface.. so i'ts just clicking a button to layout the diagram...
http://www.sparxsystems.com/enterprise_architect_user_guide/9.3/modeling_basics/layout_diagrams.html
http://www.sparxsystems.com/enterprise_architect_user_guide/9.3/modeling_basics/auto_route_layout.html
-
Check LayoutDiagramEx which provides more options (like the layout style which includes auto-route). I have not tested it, but according to the help it should work.
q.