I Want to run this script each 2 floor at one go like one after next below

image
as i have no knowledge of python, i an seeking help here
Thankyou in advance!!!
script–
import clr

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

clr.AddReference(‘RevitAPIUI’)
from Autodesk.Revit.UI import *

clr.AddReference(‘System’)
from System.Collections.Generic import List

clr.AddReference(‘RevitNodes’)
import Revit
clr.ImportExtensions(Revit.GeometryConversion)
clr.ImportExtensions(Revit.Elements)

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

doc = DocumentManager.Instance.CurrentDBDocument
uidoc=DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument

walls = UnwrapElement(IN[0])

TransactionManager.Instance.EnsureInTransaction(doc)

joined =

for x in walls:
for y in walls:
filterIntersect = ElementIntersectsElementFilter(x)
if x is not y:
if filterIntersect.PassesFilter(y):
joined.append(y)
try:
JoinGeometryUtils.JoinGeometry(doc,x,y)
except:
pass
else:
point = x.Location.Curve.Origin.ToPoint()
curve = y.Location.Curve.ToProtoType()
distance = curve.DistanceTo(point)
thickF = (x.Width + y.Width)/2
thickM = UnitUtils.ConvertFromInternalUnits(thickF,DisplayUnitType.DUT_MILLIMETERS)
if distance == thickM:
joined.append(y)
try:
JoinGeometryUtils.JoinGeometry(doc,x,y)
except:
pass

TransactionManager.Instance.TransactionTaskDone()

OUT = joined

Are you just trying to join the floors in revit?

There are nodes to do this, python isn’t required.

yes, oh can you suggest that node?
here i am trying joining multiple floors at one click

Hi @vikas.kpoojary i would try something here i guess…

the lists are already spited, I want know is that possible run two floor one after another like a loop thorough given python script ?

allright, why not just a list.transpose and then join as showed, not sure i understand then

run script like loop or sequence like 1,2,3… and so on. here i am joining the floors which is intersected but not joined
image

As sovitek said you can transpose those pairs into two lists and join them that way. Do try his approach and if it doesnt work then you must have a different list structure.

I gave you python code in the other thread. If you need more python code maybe try to take some time to learn about it first.

1 Like

or just first.item - last.item set to level@2 instead of transpose…seems you python is for walls, but your example is for floors ?

In my case wall in my code was a variable name, but you could just send any joinable elements in im pretty sure.

1 Like

arhh its your code :wink:

1 Like

Original code no idea. The looped version i built based on it.

1 Like

arhh…i see…anyway inthat case here i would just use ootb…and transpose :wink:

1 Like

this code is not working😕
for splitting the list i am using slice node, one below another so that the script will run
and its working fine, but it will become huge node tree so…