Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: Mike Chapman 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.
-
Try ProjectInterface.Project.SaveDiagramImageToFile (string Filename)
b.
-
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.