I humbly suggest the following change to rs.ExplodeMeshes:
def ExplodeMeshes(mesh_ids, delete=False):
"""Explodes a mesh object, or mesh objects int submeshes. A submesh is a
collection of mesh faces that are contained within a closed loop of
unwelded mesh edges. Unwelded mesh edges are where the mesh faces that
share the edge have unique mesh vertices (not mesh topology vertices)
at both ends of the edge
Parameters:
mesh_ids = list of mesh identifiers
delete[opt] = delete the input meshes
Returns:
List of identifiers
"""
id = rhutil.coerceguid(mesh_ids)
if id: mesh_ids = [mesh_ids]
rc = []
for mesh_id in mesh_ids:
mesh = rhutil.coercemesh(mesh_id, True)
if mesh:
submeshes = mesh.ExplodeAtUnweldedEdges()
if submeshes:
for submesh in submeshes:
id = scriptcontext.doc.Objects.AddMesh(submesh)
if id!=System.Guid.Empty: rc.append(id)
if rc: scriptcontext.doc.Views.Redraw()
if delete:
for id in mesh_ids:
scriptcontext.doc.Objects.Delete(id, True)
return rc
with the addition being the 2nd, 3rd and 4th last lines