Author Topic: How to check if a diagram being operated on is unsaved?  (Read 3838 times)

kjourdan

  • EA User
  • **
  • Posts: 71
  • Karma: +0/-0
    • View Profile
How to check if a diagram being operated on is unsaved?
« on: March 30, 2016, 01:20:37 am »
I working on some scripts (Jscript) that manipulate elements on a diagram.  The scripts would fail if the diagram was not saved prior to running the script.  I can add the logic to save the diagram. However, I would prefer to check if the diagram has been modified and not saved. Then I can prompt the user to either cancel out of the script or press OK to save.  If there are no changes, this prompt could be avoided.  Is there a way, through the scripting to know if the diagram (DiagramID) being operated on is modified and not saved?  I do not see any diagram attributes that would indicate this.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: How to check if a diagram being operated on is unsaved?
« Reply #1 on: March 30, 2016, 02:07:55 am »
You can't find that out. If you issue a diagram close, EA will ask to save. But there is not flag.

q.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13404
  • Karma: +567/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: How to check if a diagram being operated on is unsaved?
« Reply #2 on: March 30, 2016, 05:02:42 am »
I had the same problem and I just saved the diagram to be sure not to loose anything.

Geert