Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#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;
var rel = o.concept;
var source = o.source;
var target = o.target;
o.delete();
view.add(rel, source, target);
})
@smileham
Copy link

smileham commented Sep 17, 2018

Very handy! Thanks for sharing!

@timhale7
Copy link

timhale7 commented Feb 14, 2019

any advice on how to access the bendpoint attributes? I'd like to create a variant of this script that reverses the direction of the relationship (where allowed) and preserve the endpoints that already established.

@markbacker
Copy link

markbacker commented Mar 26, 2021

This is indeed a very handy script. I use it a lot.

With the new jArchi scripting plugin with GraalVM, it is not working anymore. The filtering function gives a conversion error.

Here a solution that works in both Nashorn and GraalVM :
Replace the first line
$(selection).filter("relationship").filter(function(o) {return o.view}).each(function(o) {
with
$(selection).filter("relationship").filter(function (o) {return (o.id != o.concept.id) }).each(function (o) {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment