Author Topic: GetCurrentDiagram always returns nothing  (Read 16030 times)

qwerty

  • EA Guru
  • *****
  • Posts: 13434
  • Karma: +390/-299
  • I'm no guru at all
    • View Profile
Re: GetCurrentDiagram always returns nothing
« Reply #30 on: September 19, 2017, 07:09:11 am »
There's always one of those diagram windows in FOCUS and that's what counts. If the scripting window is open and you start debugging from there it will be the "diagram" in question which for GetCurrentDiagram is no valid (so a Null) diagram.

q.

MaXyM

  • EA User
  • **
  • Posts: 120
  • Karma: +8/-0
    • View Profile
Re: GetCurrentDiagram always returns nothing
« Reply #31 on: September 19, 2017, 07:04:30 pm »
Yes, I understand how it works right now (or rather how it doesn't work, though).
IMO it should be considered as glitch, since GetCurrentDiagram() suggests nothing about focus nor working with other window which contain something else but diagram.
I'm going to report the issue.

Thank you for confirming the issue as well as pointing to workarounds.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 7953
  • Karma: +112/-20
    • View Profile
Re: GetCurrentDiagram always returns nothing
« Reply #32 on: September 21, 2017, 08:55:42 am »
AFAIK GetCurrentDiagram only returns the visible diagram in the main window.

Unfortunately, it's smarter/more annoying than that. A simple description would be that it is the last main window you have interacted with. That means that if you start a script using either the debug or run buttons on the script editor you will never have a current diagram, because that script editor will be the current view.