Author Topic: Saving a Diagram as an image  (Read 2810 times)

Mike Chapman

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
Saving a Diagram as an image
« on: September 23, 2010, 01:47:33 am »
Greetings from a novice EA automation hacker.  I would like to programmatically create an image that represents a given Diagram.  Exporting it to a file would be just fine.

I see the functionality that I want in the Diagram->Save Image menu item, but I don't see it in the automation interface.  Did I miss something?

If the functionality I desire is not available to me directly, then is there a way to invoke menu functionality through an automation interface?  I saw suggestions of throwing Windows events at the application, or faking key events, in another thread.  Trouble is, this would not just be a simple menu invoke, but interaction with a dialog afterward... and that would make it more ugly and brittle, I would think.  Maybe not even feasible, I'm not sure.

beginner

  • Guest
Re: Saving a Diagram as an image
« Reply #1 on: September 23, 2010, 03:48:14 am »
Try ProjectInterface.Project.SaveDiagramImageToFile (string Filename)


b.

Mike Chapman

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
Re: Saving a Diagram as an image
« Reply #2 on: September 28, 2010, 01:14:18 am »
Aha, I was not looking at the Project interface, thank you!

I don't want to depend on what the 'current diagram' is, so I will use the PutDiagramImageToFile(guid, filename, type) method so I can specify the guid of the diagram that I want to export.

Again, thanks for pointing me at the right interface.