Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: Viking on June 09, 2025, 11:41:58 pm

Title: Highlight / select a visible Connector / Link
Post by: Viking 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.
Title: Re: Highlight / select a visible Connector / Link
Post by: Takeshi K on June 10, 2025, 08:24:22 am
The Diagram.SelectedConnector might help you.
Title: Re: Highlight / select a visible Connector / Link
Post by: Geert Bellekens 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
Title: Re: Highlight / select a visible Connector / Link
Post by: Viking on June 10, 2025, 05:09:26 pm
The Diagram.SelectedConnector might help you.

Many thanks.

Code: [Select]
diagram.SelectedConnector = connector;
diagram.Update();
Title: Re: Highlight / select a visible Connector / Link
Post by: Geert Bellekens 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
Title: Re: Highlight / select a visible Connector / Link
Post by: Viking 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  ;)