Revit API : Walls junction with WallUtils.AllowWallJoinAtEnd()

Hi everyone,

I used the WallUtils method to join all my walls, when I ran my dynamo nothing happened.

You can find in below my script in python :

#Import librairies and Namespaces
import clr
import System
import math
clr.AddReference(‘ProtoGeometry’)
clr.AddReference(‘RevitAPI’)
clr.AddReference(‘RevitAPIUI’)

from Autodesk.DesignScript.Geometry import *

#Document and Transaction
clr.AddReference(“RevitServices”)
import RevitServices
from RevitServices.Persistence import DocumentManager
from Autodesk.Revit.DB import WallUtils
import Autodesk
from Autodesk.Revit.DB.WallUtils import AllowWallJoinAtEnd

#Define the inputdata

Walls = UnwrapElement(IN[0])

#Creating a variable doc which set the active Revit application and document

doc = DocumentManager.Instance.CurrentDBDocument

#Start the script
#By default all walls are allowed to join at ends, so this function is only needed if this wall end is already disallowed to join.
#If this wall is a stacked wall, all subwalls at this end will be allowed to join.i=0

for wall in Walls:
w=WallUtils.AllowWallJoinAtEnd(wall,0)

Thank you for your help :slight_smile: !

Any changes to model must be done within transaction

Yes, I put it but it’s the same problem :frowning:

#Import librairies and Namespaces
import clr
import System
import math
clr.AddReference(‘ProtoGeometry’)
clr.AddReference(‘RevitAPI’)
clr.AddReference(‘RevitAPIUI’)

from Autodesk.DesignScript.Geometry import *

#Document and Transaction
clr.AddReference(“RevitServices”)
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
from Autodesk.Revit.DB import WallUtils
import Autodesk
from Autodesk.Revit.DB.WallUtils import AllowWallJoinAtEnd

#Define the inputdata

Walls = UnwrapElement(IN[0])

#Creating a variable doc which set the active Revit application and document

doc = DocumentManager.Instance.CurrentDBDocument
TransactionManager.Instance.EnsureInTransaction(doc)
#Start the script
#By default all walls are allowed to join at ends, so this function is only needed if this wall end is already disallowed to join.
#If this wall is a stacked wall, all subwalls at this end will be allowed to join.i=0
for wall in Walls:
w=WallUtils.AllowWallJoinAtEnd(wall,0)

TransactionManager.Instance.TransactionTaskDone()

You probably want to use JoinGeometry. WallUtils only controls autojoin at wall ends. You should reconsider if you want to join walls geometry in your graph. Jeremy Tammik explains this in his post here.

1 Like