Dimension from faces of an Element

Hi all,
Recently I have been attempting to dimension from the actual faces of a wall in a Section/Elevation View in order to show overall Length & Height, and Openings.
I have had some minimal success with the DimensionBYElement node that was recently added to dynamo. but only after adding detail lines to the view and dimensioning between them.

A few things I have learned:

  • If you can project the line that you want to offset the dimension to in dynamo, it does not necessarily need to exist on the same plane as the section cut; it only needs to be perpendicular with the elements that are being dimensioned; it can also be placed beyond the crop region.
    *The elements that you want to dimension seem like they must be on the section view cut plane, not just within the view depth.
    *Dynamo seems to have trouble with referencing extracted parts of an element instead of just referencing separate elements altogether - that is the part I need the most help with.

Thanks to all who have been active in helping figure these sorts of thing out.
Any insight would be appreciated!

Dimension.experimental.dyn (74.7 KB)

Hey dcmasten1,

I’ve started a project on this topic: Auto Dimension in Assembly Views
I think that basically we try to do similar things. Hopefully we can help each other to make it work.

~Cheers

Hi,

Interesting, any further update on this?

unfortunately not. Hopefully there’ll be an update soon

Hi Marlo,

Have you seen the blog of @maarten vroegindeweij?
http://revitstructure-nl.blogspot.nl/2017/04/automatische-maatvoering.html
You can download the .dyn file at his blog witch contains a Python script.
Maybe it’s the Python script that can help you.

Mark

Hey Mark,

Thanks for this link! I’ve had a look into this, and tried to use the method from Maarten VroegInDeWeij to generate the needed elementreferences, but so far i have had some trouble in generating the dimensions.

I’m using the Element.Location node and create a line over the element i want to dimension. But the line doesn’t seem to have the GeometryCurve parameter which it needs for the dimension node. So far i haven’t been able to fix this. Any ideas are welcome.

Hi Marlo,

Sorry i can’t help you with this :sweat:.
I’m still learning Dynamo/Python, and do a lot of reading on this forum.
That’s why I thougt the above link could be off help for you.

Hello,
I’m working on a same kind of script which should dimension faces off walls in sectionviews. I ran into the same error. The node Element Surfaces References by GeniusLoci provides more references than Dimension by Element can handle. To make it work, exterior and interior faces shouldn’t be in the out list. I found a Python script that does just that, but it doesn’t work with multiple input/output.

This is the original script. It goes like this: First select a wall , then select a line which is in the same direction. A dimension line is placed.
curtainDim.dyn (8.7 KB)

In the python below I blocked the command which places the dimenion line and I let it give the references as an output.

import clr

#The inputs to this node will be stored as a list in the IN variables.
wall = UnwrapElement(IN[0])
lineElement = UnwrapElement(IN[1])
view = UnwrapElement(IN[2])

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

clr.AddReference(“RevitServices”)
import RevitServices
from RevitServices.Transactions import TransactionManager
from RevitServices.Persistence import DocumentManager

def isParallel(v1,v2):
return v1.CrossProduct(v2).IsAlmostEqualTo(XYZ(0,0,0))

line = lineElement.GeometryCurve
lineDir = line.GetEndPoint(1) - line.GetEndPoint(0)

refArray = ReferenceArray()

doc = DocumentManager.Instance.CurrentDBDocument

options = Options()
options.ComputeReferences = True
options.IncludeNonVisibleObjects = True

geoElement = wall.get_Geometry(options)

#get side references
for obj in geoElement:
if isinstance(obj,Solid):
for f in obj.Faces:
faceNormal = f.FaceNormal
if isParallel(faceNormal,lineDir):
refArray.Append(f.Reference)

TransactionManager.Instance.EnsureInTransaction(doc)

##doc.Create.NewDimension(view, line, refArray)

TransactionManager.Instance.TransactionTaskDone()

#Assign your output to the OUT variable.
OUT = refArray

My knowledge of python is (extremely) limited so I can’t solve it on my own.
Can somebody please help me to adjust this script so it can handle multiple walls, lines (detailcurves) and views.

Thanks in advance.
Fred

multiple faces.dyn (97.2 KB) multiple faces RVT 2019.rvt (912 KB)


Through a workaround I got where I wanted to go.
By using “Compound Edges References” by GeniusLoci I get all the vertical lines and references. Then make a list off all the lines which are parallel to the direction of the wall. By using “List.AllIndicesOff” and apply the list off the lines to the list off references I get the right faces. There are still to many references because they are made up off the interior and exterior side off the wall. So the list is split in 2.
Put these references in “Dimension by References” and the job is done.

multiple faces_version2.dyn (126.5 KB)