Column Dimension Base on Closest Grid

Hi,

I’m working on a Dynamo script to automatically place dimensions from structural columns to the closest grid lines. I’ve successfully found the closest grids and the preview lines show correctly in Dynamo, but the Dimension.ByReferences node returns null, and no dimensions are placed.

Here’s what I’ve done:

  • I’m collecting columns and grids using All Elements of Category.
  • I calculate the closest grid to each column.
  • The lines are visualized correctly in Dynamo’s background preview.
  • The node outputs null, and no dimensions are created.

What I need help with:

  • Can someone help me find where the error might be?
  • Are there common mistakes that cause Dimension.ByReferences to fail silently like this?

And any good practices when doing dimensions in dynamo

Thank you

Here’s the Preview

My initial thought is it’s a list @ level issue, I’d try setting both the Lines and Ref lines list at level to level 2. What does the list structure look like for your view and for your dimension type?

Hi,

I’m not sure what you mean sir but here’s the nodes with list for dimension and view, I also tried changing the Ref Lines and Lines to level 2 in the last nodes

Btw here is my reference in that script

Okay, looks like the object type you’re using for dimension type is not what it wants. You’re passing a string when it needs a Revit element.

See if this resolves the issue, I’ll try to build a small sample on my end to verify that list at level is the issue.

Hi,

That fixed the null problem


Thank you again @patrick_podeyn

1 Like

Awesome!