Skip to content

Instantly share code, notes, and snippets.

@jfdeclercq
jfdeclercq / ExportImage.ajs
Last active Feb 23, 2020
Export View as image (PNG) with date and diagram name in filename. #jarchi
View ExportImage.ajs
//Export View as image (PNG) with date and diagram name in filename.
// Get the first view in the model
//var view = $("view").first();
var view = selection.filter("archimate-diagram-model").first();
// Get the Base64 bytes of the view in PNG format. Can use "PNG", "BMP", "JPG" or "GIF"
// Options are scale (1 - 4) and margin (pixel value)
var bytes = $.model.renderViewAsBase64(view, "JPG", {scale: 1, margin: 20});
var date = new Date();
@jfdeclercq
jfdeclercq / DiagramNote.ajs
Created Dec 9, 2018
DiagramNote.ajs #jArchi
View DiagramNote.ajs
//Script to add a note to a view with name of the view, date and your name
//Thank you to J-B Sarrodie
// Get the first view in the current selection
var view = selection.filter("archimate-diagram-model").first();
// Get current date
var currentDate = new Date();
// Create a new note and set its text
You can’t perform that action at this time.