Hello!
Is there a any way to write a script to compare the size of objects occurrence in model and the size of objects definition (according to active filter/template)???
I can get the size of obj occurrence values, but i don´t know how to get the objects definition size. Here the code:
var idioma=Context.getSelectedLanguage();
var modelos = new Array();
var objetos = new Array();
function main(){
var diretorios = ArisData.Unique(ArisData.getSelectedGroups());
var oOutput = Context.createOutputObject();
for(var d in diretorios){
modelos = modelos.concat(diretorios[d].ModelList(true));
if(listaPreenchida(modelos)){
for(var x in modelos){
objetos = objetos.concat(modelos[x].ObjOccList());
}
}
}
for (var i in objetos)
{
oOutput.OutputLn("\n Object: " + objetos[i].ObjDef().Name(idioma) , "Arial", 10, Constants.C_BLACK, Constants.C_TRANSPARENT, Constants.FMT_LEFT, 0);
oOutput.OutputLn("-- Defaut symbolnum: " + objetos[i].ObjDef().getDefaultSymbolNum() , "Arial", 10, Constants.C_BLACK, Constants.C_TRANSPARENT, Constants.FMT_LEFT, 0);
oOutput.OutputLn("\n height --- : " + objetos[i].Height(), "Arial", 10, Constants.C_BLACK, Constants.C_TRANSPARENT, Constants.FMT_LEFT, 0);
oOutput.OutputLn("\n width --- : " + objetos[i].Width(), "Arial", 10, Constants.C_BLACK, Constants.C_TRANSPARENT, Constants.FMT_LEFT, 0);
}
oOutput.WriteReport();
}
main();
Hi,
object definitions never have a size. Size is a property of an occurrence.
The only thing that comes to mind is to use the size for an object symbol as defined in the template. So if this model has a template set, you could try to find out if what the size of the object would be after setting the template. But as far as I know, this could only be done by setting the template to the model which would destroy the old size...
BR Robert
Hi,
I don't think there is anything in ARIS to do this. For a model, you only set the template via its GUID and also get only the template GUID.
Hm, but this could help:
var aTemplates = ArisData.getConfigurationTemplates( Context.getSelectedLanguage() ) for(var i=0; i<aTemplates.length; i++) { Dialogs.MsgBox("Model template name: "+aTemplates[i].getName()+"\nDescription:\n"+aTemplates[i].getDescription()) }
Ah well, or not - only language and description etc.
So what you could do is: create a new model, copy the occ into this model, set the template for the model, read the size and delete the model again.
BR Robert
"So what you could do is: create a new model, copy the occ into this model, set the template for the model, read the size and delete the model again."
--------------------------------------------------------------------
Hi Robert,
It´s not the best solution I expected to develop from Aris, but will solve the problem! :)
Thank you!