after updating my version
one of script doesn't work anymore
console.show();
console.clear();
var el_selection = selection.filter("element");
if(el_selection.size() < 2) {
window.alert("You have to select at least two elements to run this script. Note: merging relationships is not supported for the moment.");
exit();
}
var list = "Which element do you want to keep (enter its index)?";
var index = 1;
el_selection.each(function(o) {
list += "\n ("+index+") "+o.name;
index++
})
var answer = window.prompt(list, "1");
if(answer) {
var relaxed = window.confirm('By default, only documentation and properties of the target element are saved (those of merged elements are cleared). Click Ok for this behavior or Cancel if you want a "strict" mode where they are copied into target element.');
var merge_target = el_selection.get(answer-1);
var to_be_deleted = $("#null");
el_selection.not($(merge_target)).each(function(o) {
console.log('Merging "', o.name, '" into "', merge_target.name, '"');
// We don't want to delete while iterating on the collection, so create
// another collection containing the element (not object) to delete
to_be_deleted.add(concept(o));
if (relaxed) {
removeDocAndProps(concept(o));
}
concept(merge_target).merge(concept(o));
});
// Deletion loop
to_be_deleted.each(function(e) {
e.delete();
});
} else {
console.log("Merge cancelled");
}
function concept(o) {
if(o.concept)
return o.concept;
else
return o;
}
function removeDocAndProps(c) {
c.documentation = "";
c.prop().forEach(function(p) {
c.removeProp(p);
});
}
what is the problem
thanks
Hi,
Can you try to norrow it down a little bit? Can you share the error message you have on the script console and/or on the Archi error log?
Which versions (old and new) of both Archi and jArchi do/did you use?
There should not be any differences, as there have been no breaking changes in the jArchi API for a while.
Regards,
JB
(Topic moved to jArchi forum and title changed from "archi 4.9" to something more descriptive)
Please make sure you are using Archi 4.9.2 and jArchi 1.2.
I use archi 4.9.2 but I don't find how to see my jarchi version
Quote from: wnad on February 28, 2022, 10:53:41 AMI use archi 4.9.2 but I don't find how to see my jarchi version
Go to Help -> Manage Plug-ins... menu item.
it's ok this jarchi 1.2
thanks