Automated method to export Enterprise Architect diagrams?

前端 未结 4 2108
南旧
南旧 2021-02-13 12:59

Problem: A lot of our design and architecture documentation were created and maintained in Enterprise Architect - for better or worse, that is how it is. These documents are sto

4条回答
  •  天涯浪人
    2021-02-13 13:22

    VBScript is really an easy and quick possibility. I figured out a small script that allows to export a diagram. The only think you have to know is it's GUID.

    Set MyRep = CreateObject("EA.Repository")
    
    If NOT MyRep.OpenFile("D:\Repository.eap") Then
      MsgBox("Error opening file")
      WScript.Quit -1
    End If
    
    Set Project = MyRep.GetProjectInterface
    
    My_Diagram_GUID = "{2256B231-99F6-4c78-9AB0-72E24486D578}"
    
    'Vector export emf/wmf
    Project.PutDiagramImageToFile My_Diagram_GUID,"D:\Test.emf",0
    
    'Bitmap export png/bmp/...
    Project.PutDiagramImageToFile My_Diagram_GUID,"D:\Test.png",1
    

提交回复
热议问题