Disallow wall ends

Hi,
I am trying to script a disallow wall end join and before anyone point it out :smirk:. Yeah I know there are few other post out there with the same topic but non of them has really worked for me. :sweat: Furthermore, I have tried the “DisallowJoinAtEnd” in Zhukoven package and it did not work either.
So I have decided to try the python myself and have found a curtain wall in engipedia that works perfectly for me with the curtain walls
https://www.engipedia.com/disallow-joins-on-curtain-walls-with-dynamo/

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]

But as I have absolutely no experience with python I don’t have a clue to what to change to this script for it to work with walls.
Could anybody help me out?
Thanks in advance

I believe the package wombat has a disallow joins node too.

But, if yo unwanted to do it with python, I would say to just have an input for walls and you collect them outside the node.

import clr

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

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

def tolist(obj1):
	if hasattr(obj1,"__iter__"): return obj1
	else: return [obj1]

doc = DocumentManager.Instance.CurrentDBDocument

#Preparing input from dynamo to revit
walls = tolist(UnwrapElement(IN[0]))

#Do some action in a Transaction
TransactionManager.Instance.EnsureInTransaction(doc)
for e in walls:
	WallUtils.DisallowWallJoinAtEnd(e, 0)
	WallUtils.DisallowWallJoinAtEnd(e, 1)
TransactionManager.Instance.TransactionTaskDone()

OUT = walls

In Use:

6 Likes

@john_pierson Thank you that is exactly what I wanted to do.