Author Topic: Highlight / select a visible Connector / Link  (Read 949 times)

Viking

  • EA User
  • **
  • Posts: 453
  • Karma: +2/-2
    • View Profile
Highlight / select a visible Connector / Link
« on: June 09, 2025, 11:41:58 pm »
Hi, is there a possibility to highlight / select a visible connector (aka link) in an open diagram via API? GUID and ID are known for both diagram and link. V.

Takeshi K

  • EA User
  • **
  • Posts: 593
  • Karma: +39/-1
    • View Profile
Re: Highlight / select a visible Connector / Link
« Reply #1 on: June 10, 2025, 08:24:22 am »
The Diagram.SelectedConnector might help you.
--
t-kouno

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13404
  • Karma: +567/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Highlight / select a visible Connector / Link
« Reply #2 on: June 10, 2025, 04:19:34 pm »
The Diagram.SelectedConnector might help you.
That works, but sometimes you need to open another diagram, and then this diagram again to see the selected connector

Geert

Viking

  • EA User
  • **
  • Posts: 453
  • Karma: +2/-2
    • View Profile
Re: Highlight / select a visible Connector / Link
« Reply #3 on: June 10, 2025, 05:09:26 pm »
The Diagram.SelectedConnector might help you.

Many thanks.

Code: [Select]
diagram.SelectedConnector = connector;
diagram.Update();
« Last Edit: June 10, 2025, 05:26:54 pm by Viking »

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13404
  • Karma: +567/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Highlight / select a visible Connector / Link
« Reply #4 on: June 10, 2025, 05:13:58 pm »
The Diagram.SelectedConnector might help you.

Many thanks. But that does not work for me (version 15) (with and without refresh). Any ideas, what I can do in addition?

Code: [Select]
diagram.SelectedConnector = connector;
Sparx.Repository.ReloadDiagram(diagram.DiagramID);
I'm pretty sure ReloadDiagram also resets the selected elements/connectors.

Geert

Viking

  • EA User
  • **
  • Posts: 453
  • Karma: +2/-2
    • View Profile
Re: Highlight / select a visible Connector / Link
« Reply #5 on: June 10, 2025, 05:29:01 pm »

Yes. The diagram needs an update(). Sorry for editing my comment in the meantime. You were to fast for me  ;)
« Last Edit: June 11, 2025, 04:00:51 am by Viking »