Author Topic: Is there a simple way to force connectors to align using snap to grid  (Read 6696 times)

Keith Slarke

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
I guessing that for some reason this is not a function of EA as I have searched for this already and I do not think you can snap connectors to create buses for example

Any ideas

Keith


Glassboy

  • EA Practitioner
  • ***
  • Posts: 1346
  • Karma: +107/-75
    • View Profile
Re: Is there a simple way to force connectors to align using snap to grid
« Reply #1 on: February 07, 2017, 07:52:44 am »
Not sure what you mean by buses but I'd like to be able to "tree" elements below a related one.  This is probably something you should consider raising a feature request for.

qwerty

  • EA Guru
  • *****
  • Posts: 10812
  • Karma: +244/-220
  • I'm no guru at all
    • View Profile
Re: Is there a simple way to force connectors to align using snap to grid
« Reply #2 on: February 07, 2017, 08:01:36 am »
You need to do that manually or use some script to aid you doing that. Buses are usually nothing you find in UML, it's more something in electronics layout.

q.

Keith Slarke

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: Is there a simple way to force connectors to align using snap to grid
« Reply #3 on: February 07, 2017, 09:01:08 pm »
You need to do that manually or use some script to aid you doing that. Buses are usually nothing you find in UML, it's more something in electronics layout.

q.

The great thing about UML is its ability to combine real world with structured design languages. In this case I work with electronics mechanics and software so being able to show an electronic bus is something I should be able to do as I can draw pretty much anything I like in the EA tools set.

This question is just to see if the snap feature has ever been applied to connectors because if it did it would be easy to draw what I want and for that matter keep the general diagrams tidy.

Does anyone know of any scripts that can use the snap features to achieve this?


Thankyou

Keith

« Last Edit: February 07, 2017, 09:09:41 pm by Keith Slarke »

qwerty

  • EA Guru
  • *****
  • Posts: 10812
  • Karma: +244/-220
  • I'm no guru at all
    • View Profile
Re: Is there a simple way to force connectors to align using snap to grid
« Reply #4 on: February 07, 2017, 09:59:23 pm »
I doubt there is any script for this. I'd imagine that it's rather tricky to make it work. The reason is, that the position of connectors is not easily calculable. You have different styles which create semi-auto layout one can not find out. Connectors can be hidden or manually bend. What I could think of as assistance is that you find bends lying "nearby" is snap them to a common center (which probably needs to be aligned to other snap points). And for sure you can not do that live while drawing, but you need to call a script (or launch an add-in after connector creation).

IIRC, EA has some grid snap for diagrams. I don't use that, but it could help creating buses. Alas, since EAUI is in place, it might well work with elements but not with connectors, since they are 2nd class citizens.

q.

P.S. Just verified it: Tools/Options/Diagram/Behavior/Snap works only for elements.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 9733
  • Karma: +286/-30
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Is there a simple way to force connectors to align using snap to grid
« Reply #5 on: February 07, 2017, 11:15:12 pm »
If anyone figures out how exactly to determine the exact path of a connector on a diagram then please share it.
I had serious issues finding out the height of a horizontal messageflow on BPMN diagrams. I think I finally gave up and used the position of the intermediary event that was the source or target of the messageflow instead of the height of the actual connector.
For that particular purpose that was enough, but I remember it being a complete PITA to find out the positions of the endpoints of the connector, let alone the whole path.

Geert

philchudley

  • EA User
  • **
  • Posts: 581
  • Karma: +11/-0
  • UML/EA Principal Consultant / Trainer
    • View Profile
Re: Is there a simple way to force connectors to align using snap to grid
« Reply #6 on: February 08, 2017, 03:27:59 am »
A method I used to set an automated orthogonal route was to set the Path property of each connector on the diagram.

Each connector was obtained from the DiagramLinks collection from a diagram and then for each DiagramLink element in the collection the Path was set.

The Path is the coordinates of the "Bend Points" in the form of a delimited string:

"Bend1X:Bend1Y;Bend2X:Bend2Y; ... BendNX:BendNY;"

I calculated the bend points using some offset constants which were then added or subtracted from the height / width of the elements I was starting to or from.

After changing the Path, the DiagramLinks collection was Refreshed and the diagram reloaded.

Hope this helps in some little way.

Phil
follow me on Twitter

@SparxEAGuru

Keith Slarke

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: Is there a simple way to force connectors to align using snap to grid
« Reply #7 on: February 08, 2017, 04:48:51 am »
A method I used to set an automated orthogonal route was to set the Path property of each connector on the diagram.

Each connector was obtained from the DiagramLinks collection from a diagram and then for each DiagramLink element in the collection the Path was set.

The Path is the coordinates of the "Bend Points" in the form of a delimited string:

"Bend1X:Bend1Y;Bend2X:Bend2Y; ... BendNX:BendNY;"

I calculated the bend points using some offset constants which were then added or subtracted from the height / width of the elements I was starting to or from.

After changing the Path, the DiagramLinks collection was Refreshed and the diagram reloaded.

Hope this helps in some little way.

Phil


Yes thank you now I can see how to access the positions if I wanted to create a script to do this.

Keith


Keith Slarke

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: Is there a simple way to force connectors to align using snap to grid
« Reply #8 on: February 08, 2017, 04:50:48 am »
Does anyone know if you can select a line and then move the position using the keyboard rather than the mouse?

Keith

qwerty

  • EA Guru
  • *****
  • Posts: 10812
  • Karma: +244/-220
  • I'm no guru at all
    • View Profile
Re: Is there a simple way to force connectors to align using snap to grid
« Reply #9 on: February 08, 2017, 07:27:35 am »
I guess that this is not possible. And while moving an element the position is shown in the status line, you don't find any info when dragging connectors. 2nd class citizens.

q.

skiwi

  • EA Practitioner
  • ***
  • Posts: 1860
  • Karma: +38/-74
    • View Profile
It is a shame, and would be a good feature request, to allow a connector to be moved using Shift-cursor keys in the same way as entities can be moved on a diagram.


In the diagram behaviour preferences you can set "AutoTidy" and "Tidy Line Gap", hope this helps


Also pinning the start or end of a connector can assist in maintaining control.


S
Orthogonality rules
Using EA15.1 (1526) on Windows 10 Enterprise/64 bit. Repositories in SQLServer2014 R2 & Access2003/JET4.0

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 6983
  • Karma: +151/-112
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
It is a shame, and would be a good feature request, to allow a connector to be moved using Shift-cursor keys in the same way as entities can be moved on a diagram.


In the diagram behaviour preferences you can set "AutoTidy" and "Tidy Line Gap", hope this helps


Also pinning the start or end of a connector can assist in maintaining control.


S
Trap for young players:  Pinning an end may change the line type to "Custom".

HTH,
Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

qwerty

  • EA Guru
  • *****
  • Posts: 10812
  • Karma: +244/-220
  • I'm no guru at all
    • View Profile
I guess it should read "will change".

q.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 6983
  • Karma: +151/-112
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
I guess it should read "will change".

q.
Haven't tested the full set of possibilities...  However, I will accept "will, most likely,..."

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!