Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>In the Example code I just discovered a function whish will do exactly what you want. But hidden away by the not so helpfull name of <strong>ProjectInterfaceExample</strong>:</p> <pre><code>option explicit !INC Local Scripts.EAConstants-VBScript ' ' Examples of how to access and use the Project Interface. ' ' Related APIs ' ================================================================================= ' Project Interface API - http://www.sparxsystems.com/uml_tool_guide/sdk_for_enterprise_architect/project_2.html ' ' Global reference to the project interface dim projectInterface as EA.Project sub ProjectInterfaceExample() ' Show the script output window Repository.EnsureOutputVisible "Script" Session.Output( "VBScript PROJECT INTERFACE EXAMPLE" ) Session.Output( "=======================================" ) set projectInterface = Repository.GetProjectInterface() ' Iterate through all model nodes dim currentModel as EA.Package for each currentModel in Repository.Models ' Iterate through all child packages and save out their diagrams dim childPackage as EA.Package for each childPackage in currentModel.Packages DumpDiagrams childPackage next next Session.Output( "Done!" ) end sub ' ' Recursively saves all diagrams under the provided package and its children ' sub DumpDiagrams ( thePackage ) ' Cast thePackage to EA.Package so we get intellisense dim currentPackage as EA.Package set currentPackage = thePackage ' Iterate through all diagrams in the current package dim currentDiagram as EA.Diagram for each currentDiagram in currentPackage.Diagrams ' Open the diagram Repository.OpenDiagram( currentDiagram.DiagramID ) ' Save and close the diagram Session.Output( "Saving " &amp; currentDiagram.Name ) projectInterface.SaveDiagramImageToFile "c:\\temp\\" + currentDiagram.Name + ".emf" Repository.CloseDiagram( currentDiagram.DiagramID ) next ' Process child packages dim childPackage as EA.Package for each childPackage in currentPackage.Packages DumpDiagrams childPackage next end sub ProjectInterfaceExample </code></pre> <p>You might have to fine tune it a litte (i.E. not writing everything into C:\Temp) but it is a good start.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload