# Disallow wall ends

**URL:** <https://forum.dynamobim.com/t/disallow-wall-ends/52282>\
**Category:** Revit\
**Tags:** revit, python, dynamo\
**Created:** [June 25, 2020, 3:49pm UTC](https://forum.dynamobim.com/t/disallow-wall-ends/52282 "2020-06-25T15:49:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![JocoYo](https://avatars.discourse-cdn.com/v4/letter/j/8c91f0/32.png) [@JocoYo](https://forum.dynamobim.com/u/JocoYo)\
**Post date:** [June 25, 2020, 3:49pm UTC](https://forum.dynamobim.com/t/disallow-wall-ends/52282/1 "2020-06-25T15:49:14Z")

</div>

Hi,  
I am trying to script a disallow wall end join and before anyone point it out 😏. Yeah I know there are few other post out there with the same topic but non of them has really worked for me. 😓 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/](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]

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/7/d/7d8b704ec7ae4cba63d92095118ceac405bcdf29.png)

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

---

<div class="post-metadata">

**Author:** ![john\_pierson](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/john_pierson/32/191977_2.png) [@john\_pierson](https://forum.dynamobim.com/u/john_pierson)\
**Post date:** [June 25, 2020, 5:10pm UTC](https://forum.dynamobim.com/t/disallow-wall-ends/52282/2 "2020-06-25T17:10:07Z")

</div>

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.

```auto
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:

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/8/4/8468c6a36fce59b450660f20e67bedba2f2b7f21.png)

---

<div class="post-metadata">

**Author:** ![JocoYo](https://avatars.discourse-cdn.com/v4/letter/j/8c91f0/32.png) [@JocoYo](https://forum.dynamobim.com/u/JocoYo)\
**Post date:** [June 26, 2020, 6:58am UTC](https://forum.dynamobim.com/t/disallow-wall-ends/52282/3 "2020-06-26T06:58:08Z")

</div>

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