Book a Demo

Author Topic: Reload diagram without re-routing connections  (Read 4350 times)

gandel

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Reload diagram without re-routing connections
« 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:
Code: [Select]
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:
Code: [Select]
selectedConnector.Update();
currentDiagram.Update();
Repository.RefreshOpenDiagrams(true)
and it does nothing.
Now I do:
Code: [Select]
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?

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Reload diagram without re-routing connections
« Reply #1 on: February 19, 2014, 04:18:36 am »
What means "change direction"? Change the type to be Target -> Source or did you exchange Supplier and Client?

q.
« Last Edit: February 19, 2014, 04:18:50 am by qwerty »

gandel

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: Reload diagram without re-routing connections
« Reply #2 on: February 19, 2014, 05:02:01 am »
To change direction means to change value of connector attribute "Direction".

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Reload diagram without re-routing connections
« Reply #3 on: February 19, 2014, 07:50:36 am »
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.

gandel

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: Reload diagram without re-routing connections
« Reply #4 on: February 19, 2014, 08:04:16 pm »
Thanks, now it works, no other connections re-routes!
Now it is like this:
Code: [Select]
selectedConnector.Direction = "Bi-Directional";
selectedConnector.Update();
Repository.SaveDiagram(currentDiagram.DiagramID);
Repository.ReloadDiagram(currentDiagram.DiagramID);