- 
                Notifications
    You must be signed in to change notification settings 
- Fork 41
Model Functions
        Phil Beauvoir edited this page Jul 20, 2018 
        ·
        12 revisions
      
    The following functions work on the $.model global variable.
Create a new model:
var newModel = $.model.create("Test Model");
newModel.setAsCurrent(); // Set it to be the current model ("model")Load a model from file:
var myModel = $.model.load("/path/test.archimate");
myModel.setAsCurrent(); // Set it to be the current model ("model")
model.openInUI(); // Open it in the UI (Models Tree)Get the image data encoded as Base64 from a View.
var view = ...; // A view reference
var bytes = $.model.renderViewAsBase64(view, "PNG"); // Get bytes
// Embed in a HTML string
var html += "<html><body><p>" + view.name + "</p>" + "<img src=\"data:image/png;base64," + bytes + "\"></body></html>";If you value and use Archi please consider making a donation. Thanks!