Numbering doors based on a grid


Would it be possible to number doors(or any other lement) for that matters, based on grids?


So far I’ve been able to get the door location(X,Y) and the grid Curve (X,Y). Now i have a few more precise questions :slight_smile:
1 - Can i split "vertical and horizontal grids based on they’re curves?

2 - Once i got that, which X values should i extract (Can i only care about start point?)
3- How do i compare that value to the door values to select the closest?




Daniel, to get you started with items 1 and 2:

You can turn every line in Dynamo into a vector with the Line.Direction node. You could then query each vector’s X and Y. With that information fed into a simple conditional statement (e.g. x == 0) you can determine if any given grifline is horizontal or vertical (and you can use that information to filter your list of grids). As long as you’re dealing with vertical and horizontal lines only, you can use the start point or the endpoint to extract the X or Y value.

I think item 3 will likely require some scripting, but let’s deal with that once you’re through with items 1 and 2 (or somebody else on the forum has a bright idea for item 3).


If working with a standard horizontal and vertical grid there is a fairly logical workflow. If you take the intersecting points where the grid lines meet and then compare a doors location to the x and y of these points, run a couple of iterations of >= and <=, you can narrow it down to the closest intersecting point on a grid in relation to the elements location. From this you can run it back through the original list of grid lines to find the two grid lines that that intersection sits on, retrieve their names or alternatively another parameter and name the door accordingly. The hardest part of Dynamo to learn was how to manipulate data and lists, once you have mastered this you can practically do any task, just may take a few hours to get to a working solution. If I have more time later I will post my workflow so you can see how I got to the picture below.




Here’s what i did (and once AGAIN thanks for the help)

Used the Grid .Curve to create a new set of lines.

Used those lines with the Line.Direction

Feed the Vector vale in a Code Block (x==0;) and i get only False results even though the values for X differs based on the orientation)


Konrad talked about this on his blog as well I believe. It looks like it was about a year ago, but it could still prove useful.




Definitely interested Mark. :slight_smile:


Daniel, to run you through what I did…

Select all grid elements in the model and find their rotation using the Vector.X and x==0 filter. Then run a geometry intersect between each horizontal and vertical grid line to produce a list of points. Get the location of all the door elements in your model and using Zach Krons custom node ‘Get closest n points’ find the point that is closest from the list of intersecting points. Then feed this information back into the points from the grid lines, a little bit of sorting/transposing and plug the value back into a desired parameter in the door family. I utilised the mark number to add onto the end of the given number but you could use a different method at this point. Ive attached the dgn file and sample revit file I used.


RenameElementBasedOnGrid DoorPositions


Very cool Mark :slight_smile:

Thanks a million


Hi Mark,


Thanks for sharing your cool algorithms and files. I would like to run the dyn file, but where could I find the ‘Get Closest N points’ and ‘If Equal Return Index’ custom nodes?