Multiple Join Elements...again

Dear all,

I’m starting at Dynamo and Python.

I found a script (https://www.youtube.com/watch?v=zSFs47BJtAU) to join multiple elements (walls, floors,…) but I can’t find the error at code

Does anybody could help me?

Regards

Please post the actual code, not an image of it.

@arquiteto.rafael

There’s no space here

1 Like

and a typo here:

@Konrad_K_Sobon

import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *

clr.AddReference("RevitAPI")
import Autodesk

clr.AddReference("RevitSrvices")
import RevitSevices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

clr.AddReference("RevitNodes")
import Revit
clr.ImportExtentions(Revit.Elements)

dataEnteringNode = IN

elementA = UnwrapElement (IN[0])
elementB = UnwrapElement(IN[1])

doc = DocumentManager.Instance.CurrentDBDocument

results = []
TransactionManager.Instance.EnsureInTransaction(doc)

for A in elementA:
	forB in elementB:
		try:
			result = Autodesk.Revit.DB.JoinGeometryUtils.JoinGeometry(doc,A,B)
			results.append(result)
		except:
			pass
			
				
TransactionManager.Instance.TransactionTaskDone()

OUT = results
1 Like

Finally I found all type mistakes and it’s working.
Thank you all!

Is this correct? it does not seem to be working…

Try the CombineElements() method in the Document class, it’s more suitable for this kind of operation. Plus, it’s better as you can input a list of elements rather than two at a time, so no loop (or the overhead) is necessary.