Archi Forum

Archi Plug-ins => jArchi => Topic started by: Alberto on December 12, 2018, 16:32:10 PM

Title: jArchi folder path?
Post by: Alberto on December 12, 2018, 16:32:10 PM
How do I retrieve the path of folders and name of a view or element via jArchi?

e.g. "Views\Folder 1\Folder 2\My Archimate View 1"    or "Business\Business Actor"

Title: Re: jArchi folder path?
Post by: Phil Beauvoir on December 12, 2018, 17:04:46 PM
You can use .parents() on a collection. So, for example, if you select one node on the models tree ("selection"):



var path = "";

var parents = selection.parents();

for(i = parents.length - 1; i >= 0; i--) {
    path += "\\" + parents[i].name;
}

path += "\\" + selection.first().name;