This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * Archi ↔ Excel XML (XML Spreadsheet 2003) | |
| * Single script: choose Export or Import at startup | |
| * Export: full model or selected views → .xml | |
| * Import: .xml → model (UID optional, duplicate detection with custom dialog) | |
| */ | |
| console.show(); | |
| console.clear(); | |
| // ---------- Global SWT declarations ---------- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * CreateOrUpdateCalculatedNotes.ajs | |
| * --------------------------------------------------------------------------- | |
| * Creates a note for each selected object in the current view, | |
| * or updates all notes that have the calculatedLabel property. | |
| * | |
| * Rules: | |
| * - The "calculatedLabel" property on the note stores the ID of the | |
| * visual object it refers to (enables reliable updates). | |
| * - Note text = labelValue of the object if non-empty, otherwise name. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // This script decrease the font size of the selected element | |
| // Requires jArchi - https://www.archimatetool.com | |
| // Change -1 to 1 to have IncreaseFontSize script | |
| // Assign a key to this script | |
| try{ | |
| console.log("font decreasing"); | |
| $(selection).each(function(selectedElement) { | |
| selectedElement.fontSize += -1; | |
| } ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * CreateViewFromSelection.ajs | |
| * | |
| * Creates a new ArchiMate view from the current selection, | |
| * OR updates an existing generated view if one is selected. | |
| * | |
| * Identity: The view carries a user property "generated-by-script" = "CreateViewFromSelection" | |
| * and a JSON property "generation-criteria" storing the full criteria. | |
| * | |
| * Update mode (view with that property selected): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Merge Two Selected Archi Objects | |
| * | |
| * Works with either: | |
| * - Two elements of the same type | |
| * - Two relationships of the same type, source and target | |
| * | |
| * An SWT dialog lets the user choose, for each field (name, documentation, | |
| * each property), which value to keep — or to merge both documentation texts. | |
| * |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Author: Jean-Charles Perron, based on the work of Rob Kamp | |
| // Requires: jArchi - https://www.archimatetool.com/blog/2018/07/02/jarchi/ | |
| // Purpose: SWT dialog to align (left, top, bottom, right) and spread (horizontal, vertical) selected elements | |
| // Date: 2024-01 | |
| // Version: 2.2 | |
| // Changes: | |
| // 1.0 - Initial version (Rob Kamp / Jean-Charles Perron): spread vertical/horizontal via prompt | |
| // 2.0 - SWT dialog with align left/top/bottom/right + spread H/V, closeable with ESC | |
| // 2.1 - Dual behaviour: children mode vs normal mode | |
| // 2.2 - Children mode reworked: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * JArchi Script - Modify User Property Value | |
| * | |
| * This script allows you to search and replace a property value | |
| * on all model objects that have this property. | |
| * | |
| * Uses SWT dialog boxes for user interaction. | |
| */ | |
| // Import necessary SWT classes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * Distribute relationships between multiple selected elements | |
| * Enhanced version - supports multiple elements selection | |
| * Based on: https://forum.archimatetool.com/index.php?topic=1174.0 | |
| */ | |
| console.log("Distribute relations - Multi-element version"); | |
| var view = selection.parents().filter('archimate-diagram-model').first(); | |
| var elements = selection.filter('element'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * JArchi Script - Search and Create View | |
| * Search for model elements by text and create a view with the results | |
| */ | |
| // Import necessary SWT classes | |
| var SWT = Java.type('org.eclipse.swt.SWT'); | |
| var Shell = Java.type('org.eclipse.swt.widgets.Shell'); | |
| var Display = Java.type('org.eclipse.swt.widgets.Display'); | |
| var Dialog = Java.type('org.eclipse.swt.widgets.Dialog'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * JArchi Script: Duplicate Relationships | |
| * | |
| * This script duplicates selected relationships by creating: | |
| * - A new relationship with the same type, source, target and properties | |
| * - Visual connections in all views where the original relationship appears (optional) | |
| * | |
| * Usage: Select one or more relationships and run the script | |
| */ |
NewerOlder