Also the time to extract the data to build a surface is excessive. You have to pull the bounding box (quick,e ven for 5000 instances), but then extract and manipulate those points (for rectangle creation there isn’t a “by two points” which I know of so you have to do some XY component value work), and then offset each individual rectangle, and patch it (all time consuming options).
Better to do what AutoCAD does and process the source geometry in the block and go from there. Learn from the best, right?
Anyway, this is my solution:
The areas where it looks like the shapes should union are due to a change in the Z coordinate for the rows - most instances are at an elevation of 5 units and change and the small sections are over 11. Pulling the coordinate systems onto a single plane will resolve that, but I am not sure if that’s desired or not.
The graph:
Note that it does make use of the “Smart Surface Union” which I provided the Python for here: Help Consolidating Dynamo Graphs - #12 by jacob.small