Problem with Orientation of Replacement Items

Dear All

I have put replacement items (Polygons or Rectangles) into a list of Circles on a surface.
However, the replacement items seem to vary in orientations randomly as seen in the attached file.

I have used Ramdom to select the Indexes to be replaced but I don’t think this Randomness will affect the orientation of the replacement items, most grateful if someone can point out the problem here!

Many thanks in advance!
Regards

YutakaReplacement Items Orientation Problem.gh (21.4 KB)

Please internalise your geometries!