Skip to content

Instantly share code, notes, and snippets.

@jbsarrodie
jbsarrodie / RemoveBentpoints.ajs
Created September 14, 2018 18:57
#jArchi script to remove bendpoints on selected relationships
// RemoveBentpoints
//
// Requires jArchi - https://www.archimatetool.com/blog/2018/07/02/jarchi/
//
// This script takes a selection of visual objects as input, filter it to keep only relationships and remove all their bendpoints
//
// (c) 2018 Jean-Baptiste Sarrodie
$(selection).filter("relationship").filter(function(o) {return o.view}).each(function(o) {
var view = o.view;
@jfdeclercq
jfdeclercq / DiagramNote.ajs
Created December 9, 2018 11:53
DiagramNote.ajs #jArchi
//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
@gevaertw
gevaertw / CreateAppServicePattern.ajs
Last active February 9, 2019 11:46
#jArchi Script to create default application pattern into the active model.
/*
jArchi Script to create default application pattern into the active model. It creates the objects and relations.
It puts all objects into a folder per application and creates a view.
*/
console.clear();
console.log("Creating Default Application Pattern");
//Pop up for application name, and check if that is already in the model
var appName = window.prompt("Name of the application to create", "My Application Service");
@davidsara
davidsara / Anonymize.ajs
Last active September 17, 2020 09:48
#jArchi - Removes all properties from the model.
// Removes all properties from the model.
//
// (c) 2019 David Sara
function anonymize() {
$("element").each(function(element) {
properties = $(element).prop();
if (properties.length > 0) {
properties.forEach(function(prop) {
element.removeProp(prop);
@davidsara
davidsara / Delete Unused.ajs
Last active September 17, 2020 09:48
#jArchi - Delete all unused elements (not used in any View).
// Delete all unused elements (not used in any View).
//
// (c) 2019 David Sara
function deleteUnusedElements() {
$("element").each(function(element) {
if($(element).objectRefs().isEmpty()) {
element.delete();
}
});
@gevaertw
gevaertw / ImportDataFromServiceMap.ajs
Last active December 28, 2023 20:15
#jArchi #AzureServiceMap
/*
---------------------------------------------------About------------------------------------------------------------------------------------------------------------------
Version 1
This script loads archi elements from an Azure service map into archimate. It Shows the network communication between servers as found by azure service map.
All will be drawn on an model but without considering the data already in the model. In V2 (if that ever gets created) I will work using existing models and the data it has
Use the query below in service map to get the input file. Do not change the fields or field order from the query, you can change the fileters if you like.
I highly recomend you to filter out any connection that you consider irrellevant or junk. Running an input file of 2000 lines takes around 90 seconds on my laptop.
@smileham
smileham / Search by Properties.ajs
Last active June 14, 2022 14:04
#jarchi Find all Archimate elements which match the properties of the selected element.
/*
* Search by Properties
*
* Requires jArchi - https://www.archimatetool.com/blog/2018/07/02/jarchi/
*
* Find all Archimate elements which match the properties of the selected element.
*
*
* Version 1: First release
* Version 2: Added layers to results
@felpasl
felpasl / ExportAllToMarkdown.ajs
Created June 11, 2019 15:21
#jArchi Create markdown to all Views from file based on smileham/Export to Markdown.ajs
/*
* Export All Views to Markdown
*
* Based on smileham/Export to Markdown.ajs - https://gist.github.com/smileham/578bbbb88dc0ed5a1403f3b98711ec25
* (c) 2018 Steven Mileham
*
*
* Requires jArchi - https://www.archimatetool.com/blog/2018/07/02/jarchi/
*
* Markdown - https://www.markdownguide.org/
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Script Name: Quality Check - UX Relations
Script Description:
A jArchi script for use on Archi tool models.
Using a specific view called ConceptDefinition to represent a cut down version of the full ArchiMate model,
check all the model relationships to flag up any unexpected ones.
@gevaertw
gevaertw / ArchiSQLGenerator.ajs
Last active May 14, 2024 20:36
#jarchi #ArchiSQLGenerator
/*
The goal is that a user creates a pattern on a view. Based on that pattern a SQL query is created to analyse the entire model for that view.
The model must be in a database created with herve database plugin (Link) This is very powerfull to analyse the model using SQL and by further extention BI tools like PowerBI
Check https://gevaertw.wordpress.com/generating-sql-queries-for-the-archi-database for more info
*/
//
//-------------------------- Script Settings --------------------------------------------------------------
// to set language comment or uncomment