Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: Helmut Ortmann on September 13, 2022, 12:32:00 am

Title: Can't delete DiagramLinks, peculiar
Post by: Helmut Ortmann on September 13, 2022, 12:32:00 am
Hi,

I tried to delete DiagramLinks and it seems not to work. The deletion of DiagramObjects work as expected.

Any idea?

Thanks and best regards,


Helmut

for (int i = dia.DiagramLinks.Count - 1; i >= 0; i = i - 1)
                    {
                        dia.DiagramLinks.DeleteAt((short)i, true);
                        countRemovedDiagramLinks++;
                    }
                    dia.DiagramLinks.Refresh();
for (int i = dia.DiagramObjects.Count - 1; i >= 0; i = i - 1)
                    {
                        dia.DiagramObjects.DeleteAt((short)i, true);
                        countRemovedDiagramObjects++;
                    }
                    //dia.Update();
                    dia.DiagramObjects.Refresh();
Title: Re: Can't delete DiagramLinks, peculiar
Post by: Helmut Ortmann on September 13, 2022, 12:57:03 am
I think I have found the issue.

I have to hide the DiagramLink. Deletion doesn't work.

This is done to make it easyly possible to let reappear a Diagramlink.
Title: Re: Can't delete DiagramLinks, peculiar
Post by: Geert Bellekens on September 13, 2022, 12:59:18 am
Yes, if you delete the diagramLink, EA simply recreates it based on the visible elements and the relations between them.
If you want to hide a relation you have to specifically tell EA that.

Back in the olden days, diagramLinks where even only recorded if you did something none default like hiding them.

Geert