Book a Demo

Author Topic: Automation of execution of add-in from command line  (Read 2821 times)

priombiswas89

  • EA User
  • **
  • Posts: 47
  • Karma: +0/-0
    • View Profile
Automation of execution of add-in from command line
« on: June 01, 2021, 08:44:09 pm »
I have developed an EA plugin which generates yaml from several types of UML diagram. Workflow of the add-in is depicted in below images:
Step 1: https://ibb.co/jzCpm10
Step 2:https://ibb.co/x8GJx4R

I want to automate this process. What I need to do is, while user opens a command prompt, he/she will enter

  • .eap file path
  • GUID
  • yaml file generation path

Then commands should open Enterprise architect with the project file specified, run the add-in on the diagram, and generate the yaml file to the specified path.

I am trying to use below code for the purpose. Am I on right track?

Code: [Select]
class Program
    {
        static string File = "C:/Users/priom/Documents/Enterprise Architect/StateMachineExportTest.eap";//Path to.eap-File;     
        static string GUID = "243F8FA4-D5B1-49e4-9E90-13D7A0E01ED6";//GUID of required package;                     
        static string Doc_Template = ".txt"; //Name of Document_Template
        static string FileName = "Output";//Name of generated File;
       
        static void Main(string[] args)
        {
            EA.App EAClient = new EA.App();
            EA.Repository EA_Repo = new EA.Repository();
            //EA_Repo.LoadAddins();
            EA.Project EA_Proj = new EA.Project();   
            EA_Repo.OpenFile(File);
            EAClient.Visible = false;
            EA_Proj = EA_Repo.GetProjectInterface();
            EA_Proj.RunHTMLReport(GUID, "c:\\test", "PNG", "default", "htm");
            //EA_Proj.RunReport(GUID, Doc_Template, FileName);
            EA_Repo.Exit();
            Console.ReadKey();
        }
    }
« Last Edit: June 02, 2021, 12:53:34 am by priombiswas89 »