Nested loop Collision detection

Hi, I’m trying to create a script using a set number of library panels and arraying them through an anemone looped function. The function essentially selects the point on a grid and moves the panel into place. After the move it checks for intersections with other panels, and if there are any it reselects a point for the geometry to be moved to until there are no collisions.

The questions I have are:

  1. is there a way to maintain data continuity in the loop i.e as the geometry is arrayed it is kept in the loop as a new library rather than being erased, as i’m currently using a data recorder to try to record it but it doesn’t seem to be working.
  2. Collision detection seems to intermittently work but I’m not sure why its not triggering.

Thanks.


Attached is the file. Wall Feature looped Panelization_v2.gh (42.8 KB)