Simplifying a grasshopper script

Hi. I am trying to use rhino.inside to import rhino polysurfaces into revit with each rhino layer being a different category in revit. I have multiple scripts that are almost identical except for their material type and their categories. I am very new to grasshopper so I’m not sure how to simplify this script but I’m sure there is a way. Any help would be greatly appreciated.
Import to Revit with categories 2024-07-16 v2.gh (30.4 KB)


You should be able to graft most, if the categories are aligned.

Can you post an example .3dm file, along with the gh.

What version of Rhino & Revit are you working in? Thanks

Here are those files. I am using Rhino 7 and Revit 2024. Let me know if that works. Thank you!
2024-07-16_Pavilion with add on.3dm (15.0 MB)
Import to Revit with categories 2024-07-16 v2.gh (23.5 KB)

Something like this will work, but you’ll want to ensure your geometry can make it into Revit first (one of the drawbacks of doing them all at once – harder to troubleshoot)

Import to Revit.gh (26.2 KB)

https://www.rhino3d.com/inside/revit/1.0/guides/rir-grasshopper#tolerances