Create rebar across current plane

Hi all. So this script works nicely for selecting to space rebar between two edges. The problem is it always populates them into the z plane. This is always a bit of a problem I have with revit, that when setting the spacing at maximum for single rebar, it always populates into the slab

https://villaron.sharepoint.com/:i:/s/SBPAdminSales/EfbO8mnldwpFuid7G6G_7UMBrDwOuJupi3UpdUbUIEg5Zw?e=OHbZRG