# Create floor with Grids

**URL:** <https://forum.dynamobim.com/t/create-floor-with-grids/76585>\
**Category:** Revit\
**Tags:** dynamo\
**Created:** [May 16, 2022, 8:00am UTC](https://forum.dynamobim.com/t/create-floor-with-grids/76585 "2022-05-16T08:00:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![vanquyet9494](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/vanquyet9494/32/119101_2.png) [@vanquyet9494](https://forum.dynamobim.com/u/vanquyet9494)\
**Post date:** [May 16, 2022, 8:00am UTC](https://forum.dynamobim.com/t/create-floor-with-grids/76585/1 "2022-05-16T08:00:17Z")

</div>

I need to create a floor from an existing grid, how can I get curveloop from grid

 ![Slab](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/1/9/19ad51d666e75bee33919da58e68d5fef3307f47.png)

---

<div class="post-metadata">

**Author:** ![Mark.Ackerley](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/mark.ackerley/32/79310_2.png) [@Mark.Ackerley](https://forum.dynamobim.com/u/Mark.Ackerley)\
**Post date:** [May 16, 2022, 9:06am UTC](https://forum.dynamobim.com/t/create-floor-with-grids/76585/2 "2022-05-16T09:06:46Z")

</div>

Hey,

I think you’re going to have to do a lot of work to isolate those lines which are in rectangles, and to order them correctly so they make a loop.

You can sort and group the lines by their Direction, and their setout from 0,0.

Their is a great node in Ampersand called Geometry.SplitByTools which will recursively split your lines.

You can check whether a split line end point has an intersect, if not, filter out the line, because is not part of a rectangle (it’s one of those end pieces).

Then you have to logically group the lines into 4s… There is a node in springs called ‘subpairs’ which will help.

Here’s a start for you, hope it helps,

Mark

 ![1](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/2/c/2ca12671983ad315d387a0028f2642cf9f6abc3d.png)

---

<div class="post-metadata">

**Author:** ![Draxl\_Andreas](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/draxl_andreas/32/145744_2.png) [@Draxl\_Andreas](https://forum.dynamobim.com/u/Draxl_Andreas)\
**Post date:** [May 16, 2022, 8:20pm UTC](https://forum.dynamobim.com/t/create-floor-with-grids/76585/3 "2022-05-16T20:20:01Z")

</div>

@vanquyet9494@Mark.Ackerley  
It worked well, but my line-sorting is a mess…

[RasterGridFloorCreation.dyn](https://forum.dynamobim.com/uploads/short-url/d4UCxdRwZCq3Ef5fnBSRsaEYqhQ.dyn) (105.1 KB)

Hope there is a _easier_ way, i tried _nearest point, sort by key, sort by function, vector.direction_, nothing worked realy ☹

 ![OverAllview](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/4/f/4fe48eed426bfbc466e70004210b137879f82e1d.png)  
 ![2022-05-16_22h16_23](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/a/b/abb2a642420b5d75cb17925c376c2654b9d2566c.png)

---

<div class="post-metadata">

**Author:** ![christian.stan](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/christian.stan/32/166296_2.png) [@christian.stan](https://forum.dynamobim.com/u/christian.stan)\
**Post date:** [May 22, 2022, 6:18am UTC](https://forum.dynamobim.com/t/create-floor-with-grids/76585/4 "2022-05-22T06:18:46Z")

</div>

hello, here is a script (the algorithm is bound to be improved, I’m a beginner)  
I don’t know if it’s an imposed constraint that the slab edges are offset (in this case, offset on the polycurve, then recreation of the polycurve 2 nodes to add)  
The mesh must necessarily be rectangular.

good day  
Cordially  
christian.stan  
[Murs et dalles automatisés sur quadrillage\_V2.dyn](https://forum.dynamobim.com/uploads/short-url/6gZ4HKfdRFQQewosLFYLdfKKY5l.dyn) (190.9 KB)

edit:  
It seems that adding the 2 extra nodes is more difficult than mentioned above

You have to take the 2nd possibility of floorByOutlineTypeandLevel and switch to long lacing

 ![Capture d’écran 2022-05-22 114721](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/9/3/93401d5bc262e6f08cfe93c7b9b56eddc0bbdca0.jpeg)

I attach the corresponding script  
with a creation by rectangles rather than the previous script (by generated surfaces) I don’t know which one is more greedy in calculation time  
[Murs et dalles automatisés sur quadrillage\_V3\_modif.dyn](https://forum.dynamobim.com/uploads/short-url/pUDefi1nWcLvzeJj7rVjlj115yo.dyn) (291.5 KB)

good day  
Cordially  
christian.stan
