Book a Demo

Author Topic: new Diagram Objects Instantly visible  (Read 3923 times)

Lars J.

  • EA User
  • **
  • Posts: 30
  • Karma: +0/-0
    • View Profile
new Diagram Objects Instantly visible
« on: June 20, 2012, 06:59:27 pm »
Hi all,

I am trying to create diagram objects for new elements on the active diagram.

The new elements have already been created. They are in a different package than the diagram.

The elements have been Update()ed and the Elements collection of the package they reside in has been Refresh()ed.

The diagram objects are created on the diagram (put in its DiagramObjects collection). The DiagramObjects have been set to the ElementID of their corresponding element (in the different package) and they have been Updated()ed. The diagram's DiagramObjects collection has been Refresh()ed.

Since this all didn't bring the wanted effect of showing the elements, I have also called RefreshOpenDiagrams(true) which also did not work.

Is there anything I might have forgotten? Or is there a workaround/hack/undocumentedFeature I can use to make the new elements visible (beside closing and opening the diagram manually - this works)?


Thanks in advance.

Lars
« Last Edit: June 20, 2012, 07:02:32 pm by califax2k »

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: new Diagram Objects Instantly visible
« Reply #1 on: June 20, 2012, 07:45:26 pm »
RefreshOpenDiagrams should do the trick, so it that doesn't work (and manually closing and opening the diagram does) then you can report that as a bug
As a temporary workaround you could try to close the diagram with Repository.CloseDiagram (long DiagramID) and then reopen it with Repository.OpenDiagram (long DiagramID)
(which seems like a better solution then the RefreshOpenDiagrams(true) anyway since now you only update what is really necessary)

Geert
Geert


Lars J.

  • EA User
  • **
  • Posts: 30
  • Karma: +0/-0
    • View Profile
Re: new Diagram Objects Instantly visible
« Reply #2 on: June 20, 2012, 08:32:33 pm »
Quote
As a temporary workaround you could try to close the diagram with Repository.CloseDiagram (long DiagramID) and then reopen it with Repository.OpenDiagram (long DiagramID)
(which seems like a better solution then the RefreshOpenDiagrams(true) anyway since now you only update what is really necessary)
Thank you very much, Geert. This solution works perfect.

best regards,

Lars

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: new Diagram Objects Instantly visible
« Reply #3 on: June 21, 2012, 07:13:56 am »
I have recently reported a bug that RefreshDiagram(1) does not refresh changed connector names. I would not be astonished if there are more bugs around.

q.