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:
- select the bolt/anchor etc.
- select which sides of the drawing i want the dimension (left, right, above, under)
- 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
- place a tag next to the dimension line
If anyone has idea’s for any of these steps, please share them =)
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;
- horizontal faces sorted from top to bottom of the element
- 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.
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.
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
from Autodesk.DesignScript.Geometry import *
from Autodesk.Revit.DB import *
# The inputs to this node will be stored as a list in the IN variables.
dataEnteringNode = IN
std = IN #surfaces from studs
pns = IN #surfaces from panels
exT = IN # Hatch edge Trail Emd
# Place your code below this line
for s in std:
for e in s:
#Where s is the surface to be used as reference fot dimensioning
# 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.
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…\
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.