//Clears all inputs
//Every type of object has a container named after the objects it handles, e.g. points, lines etc.
var containers = [materials,
                  points,
                  lines,
                  parts,
                  openings,
                  elements,
                  stress_points,
                  load_cases,
                  load_combinations
                  ];


for (var i = 0; i < containers.length; ++i) 
{  
  var container = containers[i];
  for (var j = container.count(); j > 0; --j) 
  {
     try 
     {
        container.erase(container.getNthObjectId(j))
     }
     catch (err)
     {
     }
  }
}

 applyChanges()