Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: gandel on February 19, 2014, 03:54:42 am
-
Hi,
I changed direction of connection on open diagram with my script, but the change is not visible.
I tried some methods to make it visible:
selectedConnector.Update();
currentDiagram.Update();
Repository.ReloadDiagram(long DiagramID)
it works, but in addition re-routes some of other connections, so I have to manually repair them.
I tried also:
selectedConnector.Update();
currentDiagram.Update();
Repository.RefreshOpenDiagrams(true)
and it does nothing.
Now I do:
selectedConnector.Update();
currentDiagram.Update();
Repository.CloseDiagram(currentDiagram.DiagramID);
Repository.OpenDiagram(currentDiagram.DiagramID);
and it works, but scrolls my diagram to the top left corner.
Is there any better method to make the change of direction visible?
-
What means "change direction"? Change the type to be Target -> Source or did you exchange Supplier and Client?
q.
-
To change direction means to change value of connector attribute "Direction".
-
Ok. First you do not need to call diagram.update as you change only a connector. If you issue reloadDiagram it will eventually discard changes. So you should call SaveDiagram first.
q.
-
Thanks, now it works, no other connections re-routes!
Now it is like this:
selectedConnector.Direction = "Bi-Directional";
selectedConnector.Update();
Repository.SaveDiagram(currentDiagram.DiagramID);
Repository.ReloadDiagram(currentDiagram.DiagramID);