Skip to content

Instantly share code, notes, and snippets.

View davidsara's full-sized avatar

David Sara davidsara

  • Czech Republic
View GitHub Profile
@davidsara
davidsara / BatchPropertyUpdate.ajs
Created September 17, 2020 09:47
#jArchi - Batch creating or updating properties.
// Batch creating or updating properties.
//
// (c) 2020 David Sara
var key = window.prompt("Please enter the property key", "");
var value = window.prompt("Please enter the property value", "");
$(selection).each(function (obj) {
obj.prop(key, value);
});
@davidsara
davidsara / Delete Unused.ajs
Last active September 17, 2020 09:48
#jArchi - Delete all unused elements (not used in any View).
// Delete all unused elements (not used in any View).
//
// (c) 2019 David Sara
function deleteUnusedElements() {
$("element").each(function(element) {
if($(element).objectRefs().isEmpty()) {
element.delete();
}
});
@davidsara
davidsara / Anonymize.ajs
Last active September 17, 2020 09:48
#jArchi - Removes all properties from the model.
// Removes all properties from the model.
//
// (c) 2019 David Sara
function anonymize() {
$("element").each(function(element) {
properties = $(element).prop();
if (properties.length > 0) {
properties.forEach(function(prop) {
element.removeProp(prop);