There are A LOT of posts about automatic dimensions, only a handful about using the newer Dimension.ByElements node, but most of them are out-dated.
I used a very simple script with my testing model, only nine column lines, and there seems to be a bug.
The script will pull the column lines and place a zero dimension on each one. It is only when I try to drag them (usually takes two attempts) that the actual grid-to-grid dimension show up. I am only running this script on a floor plan view, the image below happens to show a 3rd level view.
This is because you’re selecting all elements of category and not sorting your grids by angle. They’re effectively dimensioning to themselves repeatedly. Select just the grids on the Y axis and you’ll get better results. In this example I selected all numerical girds (1…6) with the select model elements node, and then used the select model element node to get the alphabetical grid (A). Note that without wiring in the line I get good results:
I ran it your way and it does snap the dimensions in correctly, but places them directly on the second grid line selection. An offset node should remedy that part so they land properly…
Because Dynamo is a one and done operation, a second group has to be added to get both horizontal and vertical grids. This also takes four manual inputs to run it.
I think that you can actually remove all manual inputs if you want. Try something like this:
get all grid elements.
filter out curves grids (and yell at whoever tried to used them)
get the grid curves.
create a vector from the start and end point of each curve.
Get the angle from the x axis to the vector about the z axis
normalize that angle to the +y quadrants (angle>=180? angle - 180 : angle;)
round the angles to the nearest reasonable number for the design.
group the grid elements by this value.
get a bounding box for each grid element and pull its maximum point.
create a line by best though points for each group of grids. Offset this line by the desired offset distance towards the center of the model (or the minimum grid points). My distance would be based on the (view scale) * 12 so 4’ for a 1/4” = 1’-0” drawing. Metric and engineering scales I’m less comfortable with.
strike a dim for each group of grids along the offset line.
Jacob, I learned a lot from this post. Thanks for what you do!
I am a Dynamo novice 3 weeks in a new job at a company eager to invest time in workflow efficiencies.
Sounds like Bill may not have been interested in mods to eliminate manual inputs.
I think I will likely attempt to implement your suggestions above. It will be a way to learn more.
Dabbled in Dynamo at previous job. I see more opportunities it apply it here.
Only meant that it didn’t sound like you were going to soon implement Jacob’s ideas to eliminate manual inputs and sharing your work. So I was considering trying myself.
Thank you for sharing. I tested your script on a test project, and it worked well. I tried it on a project for work, and the dimensions did not display, but there weren’t any errors associated with the script. How would I go about figuring out what I did incorrectly?
The gridlines were 3D, so I changed them all to 2D, and I used a dummy gridline to select for dimension placement. Any help or ideas are appreciated, thank you.
It is working now, and it seems to be because I’m using a provided template. The OOTB dimension style name was changed, and standard view templates were applied. I copied the gridlines to a test project, ran the script, then copied those dimensions back into the original project. I am still not sure why the script ran without errors, and why the dimensions did not show up in the floor plan after removing the view template and turning on all annotation categories, though.
The dimensions could have been created but in another spot making them unnoticeable.
The dimensions could have been created in a style that makes them unnoticeable.
The dimensions could have been created in the wrong view, making you miss them.
The dimensions could have been on a sketch plane out of view.
The warning may have been suppressed by the methods used in the node by your Revit build.
The warning may have been suppressed by a Dynamo or Revit update.
Amazon may have taken control of your computer as they needed it to calculate their best route for the remainder of their Amazon Galactic deliveries to various parts of the solar system.
Kidding aside: since we can’t see what your results were, we can’t know why it didn’t work. Very glad to hear you are sorted out though.