How to merge lattice pipes into solid/enclosed surface?

I built a grasshopper code to generate a simple lattice parametrically with cylinders. With this command I overlaid cylinders across one another to form several nodes that vary depending on my input parameters. When done I’m left with the lattice I want except the ends of the cylinders are open and where the cylinders intersect their is still intersecting surfaces. Is there any way to cap the cylinder ends and do an automated surface trim for all interior surfaces?