Help: rs.JoinSurfaces() doesn't work if surfaces are not joinable

I need to join multiple surfaces, some are sharing edges, and some are not, but rs.JoinSurfaces() will only return one polysurface or none, so what should I do if I need it to use it to make two or more polysurfaces?

How can I quickly check if two surfaces are joinable?

Something like:

import rhinoscriptsyntax as rs
import scriptcontext as sc
import Rhino 

srfIDs=rs.GetObjects("Select surfaces to join",8+16,preselect=True)
breps=[sc.doc.Objects.Find(srfID).Geometry for srfID in srfIDs]
joinedIDs=[sc.doc.Objects.AddBrep(brep) for brep in joined]
print "{1} {0} joined into {2} {0}".format("surfs/polysrfs",len(srfIDs),len(joined))


You wizard… I’ll digest it once I have time… If I can :smile:

I just took advantage of the fact that in Rhinocommon, JoinBreps() works like Rhino’s join command, it joins what it can and returns the joined pieces. What is in fact missing from Python rhinoscriptsyntax is in fact JoinsurfacesEx (already in vb Rhinoscript) which doesn’t care about order…



@dale can you add JoinsurfacesEx to the wishlist?