Hi,
From the palette there are two types of objects, notes and groups. I have a script to copy a view to another view
containing this code:
// add objects like grouping
var obj_copy = {} ;
$(view).find('object').each(function(vo) {
var obj=vo.concept;
var bounds = vo.bounds;
//calculate the absolute xy coordinates of nested elements.
var x=bounds.x;
var y=bounds.y;
$(vo).parents().not('folder').not('archimate-diagram-model').each(function(mum){
x=x+mum.bounds.x;
y=y+mum.bounds.y;
});
//declare copy of visual as an object and use the id of the source visual object as key
obj_copy[vo.id]=view_copy.createObject(obj, x, y, bounds.width, bounds.height, "true"); //autoNest=true
// if need be: add other attributes
});
Finishing:
I expected notes and groups to be copied but they don't. Only grouping-objects do.
Is something wrong here?
Thanks Gerald
Hi,
using 'object' in find won't work for these types of diagram objects. You have to use their class type - 'diagram-model-note' and 'diagram-model-group'
Phil