04 Feb

Disallow Joins on Curtain Walls with Dynamo

Disallowing joins on Curtain Walls 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® Curtain Walls automatically is easily achievable.

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

If you are having trouble selecting only Curtain Walls, read article about hiding Curtain Walls and just invert the filter.

Disallow Curtain Walls Joins Dynamo script

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

##### Start of generic stuff imports

import clr

# import Revit® API
clr.AddReference("RevitAPI")
import Autodesk
from Autodesk.Revit.DB import *

# import Revit® Elements
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)

# import DocumentManager and TransactionManager
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

# get current Revit document
doc = DocumentManager.Instance.CurrentDBDocument

##### End of generic stuff imports



# Unwrap input
inputs = UnwrapElement( IN[0] )
curtainWalls = []
# Initiate counter
n = 0


# Get only curtain walls from input
for e in inputs:
    try:
        elementType = doc.GetElement(e.GetTypeId())
        if elementType.Kind == WallKind.Curtain:
            curtainWalls.append(e)
            n = n + 1
    except:
        print("not curtain wall")


# Start Transaction
TransactionManager.Instance.EnsureInTransaction(doc)

for e in curtainWalls:
    Autodesk.Revit.DB.WallUtils.DisallowWallJoinAtEnd(e, 0)
    Autodesk.Revit.DB.WallUtils.DisallowWallJoinAtEnd(e, 1)

# End Transaction
TransactionManager.Instance.TransactionTaskDone()


# Wrap results
OUT = ["Disallowed joins on walls: " + str(n), curtainWalls]

DOWNLOAD THE SCRIPT

Hope you get good use of it!

2 thoughts on “Disallow Joins on Curtain Walls with Dynamo

  1. Pingback: Show/Hide Curtain Wall in V/G - engipedia

Leave a Reply

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