Divide Floors in Parts

Hi guys,

I am working on an script that splits floors into parts parallel to the span direction.

So far my approach as been as following :

  1. Select Model Floor

  2. In parallel I’m getting it in Dynamo as a solid where I am extracting the center point to use as a start point. I am also getting span direction as an angle used to rotate a vector and create a curve parallel to the span direction trimmed to the edges of the floor.

  3. I am then dividing the curve parallel to the span direction in consisted lengths ( the width of my parts)

  4. The points create of the main curve are used to create another set of curves which would be used as split lines for my parts.

  5. My floor is then used to create Parts.

Till the creation of the parts it’s similar to the Dividing parts with dynamo topic.

I tried adjusting the python script to use floors but was unsuccesfull.

My workaround was to use Elements.CreateParts and Part.DivideParts from Rhythm but that uses reference planes as to cut the floor which not always works and fills the project with reference planes.

I am still creating sketchplanes in the hopes that someone had an adjusted script which creates parts and uses the same inputs as the original ( Lines and SketchPlanes)

Thank you in advance. I appreciate all your inputs.

1 Like


Responding to my own topic I am happy to say that after a little bit more tinkering I optimized how I am creating my split lines and changes the python script at the end to accept floors ( Basically I replaced all references to wall with floors and it all works )


hello, I have tried your method and it is not working. I want to ask if you can provide some help. Do you change all wall reference to “floors” in the script, include “wall.id” and “wallList”? like change to “floors.id” and “floorsList”?

Hi chunchien, if you go carefully thrugh the script you will see that i did change the wall.id and walllist to floor.id and floorlist.
Could you screenshot your version of the full script ? I suspect is not the python script which is at fault. is the codeblock which feeds all the info in to the phthon. ( that was the one which held me back for days )
( zoom in to see the blue box )

Thanks for your reply!! I am trying to divide floor parts for multiple floors, so I try to change the other script that works for lists but failed. Therefore, I come across your post and try a simple script that only contains one curve but also failed. I have no idea what I do wrong. Here is my simple one:

and here is the one that I am working on:

I am trying to divide floors into parts by using wall location lines, and the script I only change Dividing parts with dynamo wall reference into floor and it does not work…

Thanks for taking time to read my post, I am struggling for days already.

Ok, now that you explained what you are trying to do I can probably give you some ideas. Full disclosure, I may be wrong in the way I would approach it.
First, as a general rule when working with python scripts, they only work with a flatted list. If you are trying to split multiple floors you may need to save the python script as a custom script so you can play with lacing and you would need to adjust to for a long lacing.
Second, for your script in particular, your input I think is a floor. But if you are trying to split it into parts according to walls, you might need to bring the walls in as an input as well, so you can get their location lines as curves. Those will be used to split your floor. I suspect that if the walls come short of the end of the floor then it would not split it.
From the looks of the large script you want to have an individual floor for each room ( possibly different floor finishes) ? if that is the case I would use the room perimeter to create new floors. ( Floor by perimeter , level and type). Keep the structural floor unchanged but create new floors on top ( offset by the floor thickness of your floor finish )

Thanks for your reply!! I am very appreciated it.
I really want to figure out this but I guess it is not working at this point. The script actually create parts, but it is not splitting it even if I create a perfect cutline that is right in the middle. The script error says: AttributeError: ‘List[object]’ object has no attribute ‘Id’ at line 41, which is very confusing because both my floor and sketchPlane has element ID and curves don’t suppose to have Id? I will just create new floor part as for now but I would like to know if you have any idea. Thank you.
p.s. the script I test all flatten out already.