SO
Hi,
I want to find the model counts in the database grouped different types.
Can any one suggest how can i do this in a script.
var oLV = new Object; var sMsg = ""; //Active filter contains info about allowed model types. var oMetaModel = ArisData.ActiveFilter(); //Database var oDB = ArisData.getActiveDatabase(); //List of models type nums oLV.aTypeNums = oMetaModel.ModelTypes(Constants.ARISVIEW_ALL); //For each type find list of models for (var i=0; i<oLV.aTypeNums.length; i++) { //List of models of i-th type oLV.aModels = oDB.Find(Constants.CID_MODEL, oLV.aTypeNums[i]); //Name of i-th type sMsg+= oMetaModel.ModelTypeName(oLV.aTypeNums[i]); sMsg+=": "+oLV.aModels.length+"\n"; delete oLV.aModels; } delete oLV.aTypeNums; Dialogs.MsgBox(sMsg);
Hope, this helps. It would better to improve output part, so as to write result to excel file. Because the result message could be very large in case of many model types used.