I am trying to find a way to automatically join parallel and adjacent walls (the way Revit’s UI does):

In a project I’m working on I already have walls which are parallel and adjacent one another, and the only way I managed to join them (even with the UI) is by pretending to stretch a snap point:
Is there a way with dynamo/python/revit api to do this?
I already tried the Hot Gear package and the variations of the LocationCurve.JoinType property but this is just for walls that join at an angle (
)
The “Join” command does not work in the Revit UI and so it does not in python.
I tried to disallow and then allow the WallJoins both in the Revit UI and in python but nothing…
I also tried the AutoJoinElements but still no luck. This last option is my best hope to get something working (link)
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
# Import DocumentManager and TransactionManager
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application
# Import RevitAPI
clr.AddReference("RevitAPI")
import Autodesk
from Autodesk.Revit.DB import *
#INPUTS
bool=IN[0]
if bool:
TransactionManager.Instance.EnsureInTransaction(doc)
doc.AutoJoinElements()
TransactionManager.Instance.TransactionTaskDone()
ext="done?"
else:
ext="not done?"
OUT=ext

