Auto Dimension in Assembly Views

Hello all,

From other topic on this forum (like this one; Automatic dimensions?) it seems possible to automatically generate dimensions of grids and walls.

I’m wondering if it’s possible to take this a step further to generate dimensions for assembly views like this:

Ultimately i’d like to do these steps:

  1. select the bolt/anchor etc.
  2. select which sides of the drawing i want the dimension (left, right, above, under)
  3. the script scans how many dimension lines that side already has so it can place the new one above the ones that are already there
  4. place a tag next to the dimension line

If anyone has idea’s for any of these steps, please share them =)
~cheers

Update:

I’ve finished the element and host selection.

Also i can determine in what pattern the elements are placed. This way i know in what directions i’d need to create dimensions.

The next step would be to find all the HostElement’s faces and sort them into horizontal/vertical faces and then sort them on coordinates. The end result would be 2 lists;

  1. horizontal faces sorted from top to bottom of the element
  2. vertical faces sorted from left to right of the element

I’ve found these nodes from this topic: Dimension from faces of an Element
Hopefully these will help for the second step.

1 Like

Revit 2018 has some API for references. Perhaps those can be used. I am trying to make a solution myself and haven’t been able to yet. If anyone has accomplished this, we would love to see it.

Hi,
once you’ve filtered the surfaces you need for dimensioning it’s possible to “convert” this surfaces into references. One example I use is:

    # Enable Python support and load DesignScript library
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *

clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *

# The inputs to this node will be stored as a list in the IN variables.
dataEnteringNode = IN

std = IN[0] #surfaces from studs
pns = IN[1] #surfaces from panels
exT = IN[2] # Hatch edge Trail Emd

# Place your code below this line

r=[]

i=0
for s in std:
	jn=[]
	
	if exT[i]:
		jn.append(exT[i])
	for e in s:
		#Where s is the surface to be used as reference fot dimensioning
		jn.append(e.Tags.LookupTag("RevitFaceReference"))
	jn.append(pns[i])
	#if exL[i]:
	#	jn.append(exL[i])
	
	r.append(jn)
	
	i+=1
# Assign your output to the OUT variable.
OUT = r

For dimensioning the basic recipe is composed of 3 items:
1 - References
2 - Reference line
3 - The dimension type you want to use.

If you are doing some kind of incremental dimension like baseline or ordinate, the direction of your reference line will dictate the direction of the dimension.

If you create a new dimension type while dynamo was open, usually, at least for me, I can’t use it without restarting Revit first. Dynamo does not find it.

Good Luck!

did you ever solve this problem… i am trying to automate dimensioning of assemblies… it does place a dimension , but i can’t see it…\

1 Like

I think assembly views will hide elements not selected/involved in its creation, including dimensions. In that case, you would have to unhide the element in the view. I don’t deal too much with assemblies, but you can check this in the interface.