Skip to content

Instantly share code, notes, and snippets.

@smileham
smileham / Export to Markdown.ajs
Last active October 10, 2025 15:38
Export an ArchiMate diagram to Markdown format. #jarchi
/*
* Export View to Markdown
*
* Requires jArchi - https://www.archimatetool.com/blog/2018/07/02/jarchi/
*
* Markdown - https://www.markdownguide.org/
*
* Version 2: Updated to support Diagram Groups
* Version 2.1: Add check for Selected View
* Version 2.2: Change to regex, added date of export
/*
* Change Concept Type
*
* Requires jArchi - https://www.archimatetool.com/blog/2018/07/02/jarchi/
*
* Updated from original to prompt for types
*
* Version 1: First release
* Version 2: Error handling
*
@smileham
smileham / Export to CSV.ajs
Last active May 19, 2025 10:24
Export to CSV #jarchi
/*
* Export To CSV
*
* Requires jArchi - https://www.archimatetool.com/blog/2018/07/02/jarchi/
* Requires PapaParse - https://www.papaparse.com/
* Works with Import from CSV script - https://gist.github.com/smileham/1e57a5946235e780dee5a824f664aa3d
*
* Version 1: Export to CSV
* Version 1.1: Avoid duplicate concepts exported from diagram
* Version 1.2: Fix missing properties
@smileham
smileham / Import from CSV.ajs
Last active June 6, 2025 10:59
Import from CSV #jarchi
/*
* Import from CSV
*
* Requires jArchi - https://www.archimatetool.com/blog/2018/07/02/jarchi/
* Requires PapaParse - https://www.papaparse.com/
* Works with Export to CSV Script - https://gist.github.com/smileham/15c445b17a92bd6f5dc1508e573bcd8a
*
* Version 1: Import from CSV
* Version 1.1: Force character encoding to use UTF-8
* Version 2: Support for Specialization and creates "CSVImport-timestamp" view
@smileham
smileham / Search by Properties.ajs
Last active April 3, 2025 06:53
#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
We can make this file beautiful and searchable if this error is corrected: It looks like row 8 should actually have 8 columns, instead of 5 in line 7.
Relationship ID,From Name,From Type,Relationship Type,To Name,To Type,Relationship Name,Relationship Documentation
611228f0-c06c-4ffc-9145-7f7091113cf4,[archi] jArchi Plugin,application-function,influence-relationship,Support Archi on Patreon,requirement,,
b03b0ef5-9085-4204-9cc0-b8456cca1d46,[archi] jArchi Plugin,application-function,Comprises,[archi] Export to CSV,application-function,,
5f24cdf4-66a6-4541-926e-2fcb7a08ce3c,jArchi Plugin <<Software>>,artifact,Realises,[archi] jArchi Plugin,application-function,,
937991e2-2221-4e8a-bf5b-a277d598678d,Documentation <<Folder>>,artifact,Comprises,Export to CSV.csv <<CSV>>,artifact,,
c334768f-c847-45cb-ab95-78c1bccc8966,Documentation <<Folder>>,artifact,Comprises,Export to CSV-relationship.csv <<CSV>>,artifact,,
5d8206f6-8ec3-409a-bf50-6db0e5fa59b7,[archi] Archi 4.3.3,application-component,Assigned to,[archi] jArchi Plugin,application-function,Plugin,
9c3dfe66-0b79-4da8-89d6-82111c8b5a8a,[archi] Archi 4.3.3,application-component,Serves/Used By,Develop Enterprise A
@smileham
smileham / archi-seq.puml
Last active March 18, 2026 03:38
Common include for PlantUML scripts to define ArchiMate concepts
@startuml Common
' PlantUML ArchiMate Sequence Diagram template v5
' Changelog:
' v3 Updated for new PreProcessor
' v4 Function to Procedure
' v5 Added Motivation, migrated to Styles, added Structure type
' Author: Steven Mileham (steven.mileham@gmail.com)
skinparam dpi 150
skinparam useBetaStyle true
<style>
@startuml Archi Usage
!include archi-seq.puml
title Archi Print Usage
' Define Elements
$businessActor("Architect","architect")
$applicationComponent("Archi","archi")
$applicationFunction("Update\nModel","update")
$applicationFunction("Print\nView","print")
$systemSoftware("Windows\nPrint\nService","windowsPrint")
@smileham
smileham / HeatMapByPropertyvalue.ajs
Last active January 19, 2026 14:10
jArchi script to create Heatmap (set Red, Amber or Green background to element) based on the value of a given property. #jarchi
/*
* Smart HeatMap (Numeric Gradient + Discrete)
* * Version: 8.1
* * "VIBE CODED" with Gemini - it was quick, did it better than I could in the time I had, and seems to work...
* * Changes:
* - Added Multi-selection dialog for Scope (Components vs Relationships).
* - Detects if a property is Numeric.
* - If Numeric: Allows Min/Max color selection and generates a Gradient Heatmap.
* - If Text (Discrete): Uses standard specific value coloring (limited to 10 unique values).
* - Generates stepped legends for Gradients.
@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,