I have a script that finds a number of View Reference items on a diagram. I'd like to render (renderViewAsBase64) the actual views they reference? How do I get those views in content?
Can you provide a snippet of JS where you are getting the View reference items?
Edit: I don't think that the referenced view is exposed in the jArchi API.
This is a snippet that finds the View References (linked views) inside a Grouping object.
// find the views this grouping composes
$(grouping).children().each(function(linkedView) {
if ((linkedView) && (linkedView.type == 'archimate-diagram-model' )) {
console.log ("View: ", linkedView.name, " > ", thisView.id); // this gives me the name and id of the View Reference, not the view itself.
var bytes = $.model.renderViewAsBase64(linkedView, "PNG"); // this therefore fails
// etc
}
});
Looks like the referenced View is not exposed in the jArchi API. As I'm lazy could you open a feature request? https://github.com/archimatetool/archi-scripting-plugin/issues
Will do. :)
Cheers.