Dimension.ByElements node

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.

Is this a flaw or do I need to add something?

Thanks

Script
Initial

Secondary

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:

Adding the grid.curve result as the line I get even better results (well depending on your definition of better).

Here it is in action:

5 Likes

Jacob,

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 was trying to keep the manual inputs down
Thanks for your input on this

1 Like

I think that you can actually remove all manual inputs if you want. Try something like this:

  1. get all grid elements.
  2. filter out curves grids (and yell at whoever tried to used them)
  3. get the grid curves.
  4. create a vector from the start and end point of each curve.
  5. Get the angle from the x axis to the vector about the z axis
  6. normalize that angle to the +y quadrants (angle>=180? angle - 180 : angle;)
  7. round the angles to the nearest reasonable number for the design.
  8. group the grid elements by this value.
  9. get a bounding box for each grid element and pull its maximum point.
  10. 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.
  11. strike a dim for each group of grids along the offset line.
3 Likes

The Grid.Curve node was found in another post

Seems like a lot of work for just some simple dimensions
Shouldn’t have to recreate more lines to accomplish this

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.

1 Like

@ [gmiller

I am always interested in automation, that is why I use Dynamo in the first place. What is meant by your comment?

Thanks for the detailed narrative explaining how this could be accomplished.

3 Likes

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.

I dont seem to be able to recreate this any advice on where I maybe going wrong?

Grid Dimensions Working.dyn (47.7 KB)

Im trying in a elevation but dimensions is positionate at the bottom

This tool is great! And a huge time saver!! Thank you Jacob and all who posted this!

1 Like

@jacob.small

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 could be a view thing. 2D floors plans are one thing, you CANNOT annotate a 3D view unless it is locked. Little house icon on the bottom ribbon.

Thank you, @Bill_Mutert

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.

There are a LOT of reasons this could happen.

  • 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.

2 Likes