sub kill_NONEs ActivateObjectSelTool SelectAllUsingFilter "geometry", siCheckComponentVisibility if selection.count = 0 then logmessage "Mod Tool can't find any 3D objects." exit sub end if redim obj_array(selection.count - 1) counter = 0 for each n in selection obj_array(counter) = n counter = counter + 1 next for each oObj in obj_array SelectObj oObj ' create "script object" set SO = selection(0) for each cl in SO.ActivePrimitive.Geometry.clusters if cl.type = "poly" then mesh_name = SO.name cluster_name = cl.name material_name = cl.material.name if cl.material.name = scan_material then SelectMembers mesh_name & ".polymsh.cls." & cluster_name if selection.count > 0 then ApplyTopoOp "DeleteComponent", selection, siUnspecified, siPersistentOperation logmessage "cleaned object: " & SO.name DeleteObj mesh_name & ".polymsh.cls." & cluster_name FreezeObj FreezeModeling else logmessage SO.name & " was already clean" end if end if end if next next ActivateObjectSelTool DeselectAll logmessage "Scan completed." end sub