Author Topic: Why does a Diagram not have a SelectedLinks function  (Read 6245 times)

Arnoud_B

  • EA User
  • **
  • Posts: 76
  • Karma: +0/-0
    • View Profile
Why does a Diagram not have a SelectedLinks function
« on: September 14, 2021, 06:51:01 am »
A Diagram object has a SelectedObjects function returning all the DiagramObjects that are currently selected.
However it does not have a SelectedLinks function returning all DiagramLink objects that are currently selected.
Instead it has a SelectedConnector function returning the Connector wrapped in the selected DiagramLink object. It only returns one while you can select multiple diagram links but then SelectedConnector returns null.
So my script only works when you select one connector at a time ...

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Why does a Diagram not have a SelectedLinks function
« Reply #1 on: September 14, 2021, 07:11:28 am »
Connectors are 2nd class citizens. You can select only one at a time. Try otherwise in the GUI.

q.

Arnoud_B

  • EA User
  • **
  • Posts: 76
  • Karma: +0/-0
    • View Profile
Re: Why does a Diagram not have a SelectedLinks function
« Reply #2 on: September 14, 2021, 07:56:11 am »
Well shift click does not work but if you drag a selection square over a part of your drawing you can very well select multiple Connectors. Maybe in SparxEA they are treated as second rate but the data model is rather clear on the relationships but the operations on the class do not follow it correctly. Well probably a legacy issue of something that worked different before and needed to be kept backwards compatible.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8063
  • Karma: +118/-20
    • View Profile
Re: Why does a Diagram not have a SelectedLinks function
« Reply #3 on: September 14, 2021, 09:14:02 am »
if you drag a selection square over a part of your drawing you can very well select multiple Connectors
I've never seen that behavior. As far as I'm aware the select area function only selects objects.

Arnoud_B

  • EA User
  • **
  • Posts: 76
  • Karma: +0/-0
    • View Profile
Re: Why does a Diagram not have a SelectedLinks function
« Reply #4 on: September 14, 2021, 07:56:23 pm »
Well visually the connector end points get highlighted so from that I assumed that the connectors were selected as well.
But assumptions are the cause of all errors so apparently why I assumed is not correct.
It would have been nice though ...

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Why does a Diagram not have a SelectedLinks function
« Reply #5 on: September 14, 2021, 08:51:23 pm »
No, they don't. A selected connector shows the litte squares at their ends. But the drag only selects the elements. The connectors don't show that. Try dragging one of the "selected" connectors. Won't work.

q.