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
| // Delete unused elements and relationships | |
| // | |
| // Requires jArchi - https://www.archimatetool.com/blog/2018/07/02/jarchi/ | |
| // | |
| // This script will delete any element or relationship not used in at least one view | |
| // | |
| // (c) 2020 Jean-Baptiste Sarrodie | |
| var response = window.confirm("This script will delete any element or relationship not used in at least one view. Continue?"); |
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
| /* | |
| Script: Reverse Access | |
| A jArchi script for use on an Archi repository | |
| Purpose: Reverse all selected access relationships Access Type direction (e.g. read -> write / write -> read) | |
| Useful as the default access type for an access relationship is 'write'. This allows several to be reversed. | |
| Author: Richard Heward - Tame Blue Lion | |
| Date: 28-Feb-2019 |
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
| //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(); |
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
| Public Sub SendToJoplin() | |
| Dim sToken As String, sURL As String | |
| Dim sURLNotes, sURLResources, sEscapedBody, sJSONString, sFolderID As String | |
| Dim objItem As Outlook.MailItem | |
| sToken = "REPLACE ME WITH YOUR TOKEN" | |
| sURL = "http://127.0.0.1:41184" | |
| sURLNotes = sURL & "/notes?token=" & sToken | |
| sURLResources = sURL & "/resources?token=" & sToken |
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
| function convert(selection, convertToType) { | |
| var relaxed = window.confirm('By default, selected concepts are converted, and relationships involving them that would no more be valid are converted to associations. Click Ok for this behavior or Cancel if you want a "strict" mode where relationships are not changed.'); | |
| $(selection).each(function(o) { | |
| $(concept(o)).outRels().each(function(r) { | |
| if (! $.model.isAllowedRelationship(r.type, convertToType, r.target.type)) { | |
| checkAndConvertRelationship(r, relaxed); | |
| } | |
| }); | |
| $(concept(o)).inRels().each(function(r) { |
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
| /* | |
| * Select 2 elements of the same type and merge the second one into the first one. | |
| * Optional: delete the second one when it's not in use anymore. | |
| * 2019, Ad Gerrits | |
| */ | |
| function q(text) { | |
| return '"' + text + '"'; | |
| } |
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: Rob Kamp | |
| // Requires: jArchi - https://www.archimatetool.com/blog/2018/07/02/jarchi/ | |
| // Purpose: Align to lowest, spread the selected elements horizontally, and resize to be equal size | |
| // Date: 2019-11-20 | |
| // Version 1.0 | |
| // Change: Initial version | |
| console.log("Start: Spread and Align horizontally"); | |
| minY = null; |
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: Rob Kamp | |
| // Requires: jArchi - https://www.archimatetool.com/blog/2018/07/02/jarchi/ | |
| // Purpose: Color the selected elements with web safe colors | |
| // Date: 2019-11-20 | |
| // Version 1.1 | |
| // Change: changed the title to add the #jArchi tag | |
| console.log("Start: Color the selected elemets"); | |
| // Web safe colors |
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 X. MAYEUR | |
| * | |
| * 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 create S-shape ortho connector | |
| */ | |
| // console.show() |
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 X. Mayeur | |
| * | |
| * 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 create U-shape ortho connector | |
| */ | |
| // console.show() |