Skip to content

Instantly share code, notes, and snippets.

@adgerrits
Last active October 11, 2024 09:39
Show Gist options
  • Save adgerrits/1f882ab3d13069c8ba47a74b544042d9 to your computer and use it in GitHub Desktop.
Save adgerrits/1f882ab3d13069c8ba47a74b544042d9 to your computer and use it in GitHub Desktop.
#jArchi script to show for selected elements in which views they are used
/*
* Show for selected elements in which views they are used
* 2019, Ad Gerrits
*/
function UsedInViews() {
$(selection).each(function(e){
if (typeof(e.concept) !== 'undefined') {
if($(e.concept).objectRefs().isEmpty()) {
console.setTextColor(255,0,0);
console.log(e.type + ' ' + e.name + " is not used in a view") ;
console.setDefaultTextColor();
}
$(e.concept).objectRefs().each(function(or) {
console.log(e.type + ' ' + e.name + " is used in view: " + ": " + or.view.name);
});
} else {
console.setTextColor(128,128,128);
console.log(e.type + ' ' + e.name + ' is not an Archimate concept');
console.setDefaultTextColor();
}
});
}
console.clear();
UsedInViews();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment