Looking to create an automatic dimension for a family between two references (1st Dyanmo Script)!

I am tasked with making a unistrut plan for a large project. Im looking to dive into Dynamo and this is the first task that I found Dynamo could be useful for, and hopefully simple enough for a 1st time script. I have very very basic Python/Scripting knowledge in general so please bear with me.

The two references I want to dimension between are called “SIDE1” and “SIDE2” as seen in the picture below.

Here is what I have so far for my script. I know I must be missing something, but Im not sure what. If someone could help steer me in the right direction I would much appreciate it. Im as novice as novice gets. Any help at all would be very appreciated.

Unfortunately since Im a new user, I can only embed one image…

Revit family seen below:

What I want to achieve seen below:

Welcome to the forum!

It’s always best to search for similar topics, even if just to see how other people are using the same nodes or similar workflows.

You’re missing essentially all of your inputs currently.

  1. The Document.ActiveView node requires a document to get the active view. Document.Current will give you that.
  2. The line input is the line describing where the dimension will be placed. You’ll need to figure out how you want that to be determined and then develop some logic to get that from your elements. A generic approach would be to create a line based on the references and the location of the instance, along with an offset so as not to overlap the geometry.
  3. You have the right idea for references, but you’re not getting them correctly. You’re identifying the references by name, which means you need to check the ReferenceName list instead of the elements themselves. Then you’ll have to actually get the matching Reference by it’s index with something like GetItemAtIndex.
  4. You also need to provide the DimensionType for the dimension itself. Archilab has a Get All Dimension Styles node that gathers all the dimension types in your project. You’ll still need to determine which one you want to use and either manually select it or use something like name matching to automate it.

I appreciate the response. I figured that out before I read your post,

Without completely making changes according to your post, this is what i came up with

I think I have everything except the reference part down, and maybe the line input Could you check what I came up with?

I really appreciate the feedback.

Always show your node previews so we can see what your graph is doing. You should be doing this anyway so you can see what your graph is doing too and not just guess at what you’ve done. Do the results at each step make sense? Do they match the required input(s) for the next step? Does your list structure seem ok? You should be asking and answering all of these questions when building your graph.

  1. View looks good.
  2. You’re getting all the element curves. This likely has too many geometries and many that wouldn’t work. You need to be intentional about where you place your dimension.
  3. I think you need to adjust list levels. You also shouldn’t need to transpose the list since the input expects paired references.
  4. You’re just getting the index again when filtering dimension types. Once you have the index you need to get the matching element at that index.

Hi Nick,

After I got off of work I decided to give it another crack. I think I figured out the references as long as this is what its supposed to output:
image
Which I think is correct.

I also retrieved the correct dimension type.

I am currently struggling with getting a line placed between the two references which will place the dimension. I believe I get the concept, but I cannot figure out which nodes to use. I keep getting stuck. Could you suggest some nodes and approaches you would take. Struggling, but I feel like I am learning a lot.

My initial thoughts s to call out the references again, and somehow get the position of the references, from there create the line between them. However, I think that must be the wrong approach, because I can not find a node that will give the position of the references.

Thanks for all the help.

An easy option is to get the location of the element (point) and project that onto the reference planes. You can then draw a line between those two points and offset it so as not to overlap the element.

Theres is where it get complicated now correct? Some of my elements are going North to South, West to East, and some even go at NW to SW etc, etc. Thats if I am assuming getting the location will output a coordinate system, and using those coordinates I create the points.

The location will return just a point. The planes defined by the references take into account the orientation of the element. Projecting the point onto the planes will then also result in points aligned to the orientation.

Give it a try and see where you get. It’s much easier to discuss the issues you’re actively having with images and results.