Skip to content

Instantly share code, notes, and snippets.

@risc12
risc12 / findOrCreate.ajs
Created June 18, 2025 11:02
Find or Create Archi Elements
/**
* Archi Script: Find or Create Element
*
* This script provides a user interface for finding existing elements
* or creating new elements in Archi diagrams. It uses a custom SelectionPalette
* to display and filter elements, and allows for quick element creation and placement.
*
* Element will be placed at the location of the cursor.
*
* Personally I have mapped this to cmd+p.
@projetnumero9
projetnumero9 / Attribute - replace string.ajs
Last active February 18, 2024 16:35
Search and replace a string for one or many concepts attribute (litteral string or REGEX) #jarchi
//
// Attribute - replace string
//
// (c) 2019 David GERARD
//
// Search and replace a string for one or many concepts attributes (name, documentation)
//
// Roadmap:
// - when using Regex, implement global replacement if multiple occurences
// - when the replacementString is a Regex, some corrections and improvment still needed
@fanievh
fanievh / Export Selected Folder to New Model.ajs
Last active October 9, 2025 15:05
Export Selected Folder in Source Model to New Target Model #jArchi
/*
* Export Selected Folder in Source Model to New Target Model
*
* https://gist.github.com/fanievh/4ec7d14247616846f3d16b5e22dc80a9
*
* This script copies a selected subset of a source model to a target model. The folder selected
* in the source model, will become the top level folder in the Views folder in the target model. Only
* elements, relationships, diagram objects, connections and images on any of the views in the selected
* folder in the source model, will be created in the target model.
*
@tobinsc
tobinsc / Create Visual Group with Selection.ajs
Created April 14, 2023 13:53
jArchi script to create a visual group with selection #jArchi
//
// Author: Ed Tobin
// Purpose: Create Visual Group with Selection
// Requires: jArchi - https://www.archimatetool.com/blog/2018/07/02/jarchi/
// Date: 14 April 2023
//
// WARNING: drops visual relationships between selected objects
// configure defaults:
// the size of padding around the selected elements
@cybye
cybye / gpt.ajs
Last active December 23, 2024 10:17
AutoDescribe a view and add to view documentation #jarchi
/*
* AutoDescribe a view and add to view documentation
*/
function CallApi(url,api_key, query) {
var imports = new JavaImporter(java.net, java.util, java.lang, java.io, java.nio.charset)
var result=""
@RemcoSchellekensNS
RemcoSchellekensNS / IsolateSingleViewToModel.ajs
Created February 27, 2023 15:43
#jarchi script to isolate single view to a new model containing only view and referenced elements in that view
/*
+++++++++++++++ +++++
+++++++++++++++++ +++++
+++++ +++++ +++++
+++++ +++++ +++++
++++++++++++++++ ++++++++++++++++++
++++++++++++++++++ +++++++++++++++++
+++++ +++++ ++++++
+++++ +++++ ++++++
+++++ ++++++++++++++++++
@RemcoSchellekensNS
RemcoSchellekensNS / clipboard_example.ajs
Created February 27, 2023 15:37
#jarchi script example using clipboard for text exchange
/*
* New Archi Script
*/
// Places string on clipboard
function SetClipboardString(string) {
var Toolkit = Java.type("java.awt.Toolkit");
var Transferable = Java.type("java.awt.datatransfer.StringSelection");
@RemcoSchellekensNS
RemcoSchellekensNS / MessageDialogs_JFace.ajs
Created February 27, 2023 15:35
This #jarchi script shows alternative MessageDialog windows with more options using Java "jface" dialogs
/*
* Example message dialogs via jface
*
*/
var MessageDialog= Java.type('org.eclipse.jface.dialogs.MessageDialog');
// Standard Error Message, with "ok" button and error icon
MessageDialog.openError(shell,"Error","your errortext");
@pmduque
pmduque / Export view to drawio.ajs
Last active September 25, 2025 18:06
Export an Archimate view to be imported into draw.io #jarchi #drawio
/*
* Author: Pedro Duque
* Version: 0.2
* Date: 2022-12-19
*
* PURPOSE:
* This script exports an Archimate view to imported into draw.io (aka diagrams.net).
*
* USAGE:
* - Select a view in Archi
@smileham
smileham / AuditModel.ajs
Last active August 15, 2025 12:16
#jarchi Script to audit an Archi model based on a defined metamodel
/*
* AuditModel
*
* Requires jArchi - https://www.archimatetool.com/blog/2018/07/02/jarchi/
*
* Version 0.1: Audits all elements in selected view, comparing to a view called "Audit"
* Version 0.2: Bug in "Template" selection - fixed
* Version 0.3: Audits all elements in selected view, allowing a user to select from views in an "Audit" Folder
* Creates the Audit folder and a default Audit view if one is not found.
* Version 0.4: 2023-03-11 - Support for Audit on Documentation/Properties of the View,