3D Diagrid

What’s the most efficient/fast way to create a 3D diagrid?

I tried using a 2d grid, splitting the grid curves by intersection points, extruding, then translating upwards by a sequence, then using the 1D diagrid node for making a diagrid on each face with a UV of 1, then flattening and removing duplicate curves.

This method seems very inefficient to me, as it’s slowing the script down a lot, especially in the last steps. I haven’t posted a screenshot because I’m still waiting for it to remove duplicates, and it has been 15 minutes… Anyone have some other ideas?

Update: It crashed the whole Revit on the last step.
And here’s the screenshot.