I wanna delete all models from the selected group.
My code is:

function delFiles() {
     var gr = ArisData.getSelectedGroups()[0];
     Dialogs.MsgBox("Selected group: " + gr.Name(1049));
     var delModels=gr.ModelList(true);
     Dialogs.MsgBox("Number of models: " + delModels.length);    
     for(var i = 0; i < delModels.length; i++){
          Dialogs.MsgBox("Del status of" + delModels[i].Name(1049) + " model: " + gr.Delete(delModels[i]));

function main() {


All models are closed. I can delete their manually.

But status of deleting of each model by script is "false".
Tell me please why I can not delete models from selected group.