03 May

Disallow Joins on Revit Beams with Dynamo

Disallowing joins on Beam (Structural Framing elements) in Revit is tedious job.

Good thing is that it can be solved easily with a little help of Dynamo.

If you are like me, than you don’t like depending on various Dynamo packages, especially for something simple as this. With a little help of Python code, disallowing joins on Revit Structural Framing automatically is easily achievable.

In Dynamo file there are two options (just connect appropriate lacing), disallow only selected elements, or disallow all Beam elements (instances) in the project model (as shown with orange line on the picture below).

Python node looks like this (see comments inside the code):

#### General imports  ##### 
import clr
clr.AddReference("RevitAPI")
import Autodesk
from Autodesk.Revit.DB import *
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
#### End of General imports  ##### 
# Unwrap inputs
input = UnwrapElement( IN[0] )
elements = []
#force input into list
try:
    for e in input:
        if e.Category.Name == "Structural Framing":
            elements.append(e)
except:
    if input.Category.Name == "Structural Framing": 
        elements.append(input)
# Start Transaction
doc = DocumentManager.Instance.CurrentDBDocument
TransactionManager.Instance.EnsureInTransaction(doc)
for e in elements:
    Autodesk.Revit.DB.Structure.StructuralFramingUtils.DisallowJoinAtEnd(e, 0)
    Autodesk.Revit.DB.Structure.StructuralFramingUtils.DisallowJoinAtEnd(e, 1)
# End Transaction
TransactionManager.Instance.TransactionTaskDone()
# Wrap
OUT = elements

DOWNLOAD THE SCRIPT

Hope you get good use of it!

Leave a Reply

Your email address will not be published. Required fields are marked *