I am not sure how big your repos usually are, but the one I wanted to automate is quite big. I found that generating the HTML straight out of the DB was extremely slow. Instead I do a project transfer from DBMS to local EAP, and html the local file.
I cobbled my code together quickly borrowing snippets of code from all over the internet, so there are potentially even more improvements that could be made. (Not claiming ownership of this code, but it works which is all I cared about)
I thought I would share for the next person that could use a C# implementation.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using EA;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
EA.Repository repo = new EA.Repository();
EA.Package package = null;
// PARAMETERS !!!UPDATE THESE!!!
String conn = "Enterprise_Architect --- DBType=1... etc"; //PUT WHOLE SQL STRING IN
String username = "user";
String password = "pass";
//Transfer DBMS to EAP
String eapfile = "C:\\Temp\\html\\model.eap";
String eaplog = "C:\\Temp\\html\\transfer_log.log";
repo.GetProjectInterface().ProjectTransfer(conn, eapfile, eaplog);
// Browse through structure
repo.OpenFile2(eapfile, username, password);
package = repo.GetPackageByGuid("{HARDCODED_GUI}"); //I PUT MY NODE GUI HERE TO GET WHOLE MODEL
// Generate HTML Documentation
String guid = "" + package.PackageGUID + "";
String tmppath = "C:\\Temp\\html";
String image = "PNG";
String template = "Feedback";
String ext = ".htm";
repo.GetProjectInterface().RunHTMLReport(guid, tmppath, image, template, ext);
// Close connection to database
repo.CloseFile();
}
}
}