Joining Revit Elements

Hello Guys,
I tried replicating the script from another forum “Auto Join Walls and Columns” On the forum it seems like it does what I want to achieve and I did exactly what’t on the forum script but I still get a warning:

Warning: IronPythonEvaluator.EvaluateIronPythonScript operation failed.
unexpected token ‘’

How can I resolve this?

Thank you for your help.

Lines 28,29 lack a “:” (colon)

That’s the reason for the error you get right now, but you also need to unwrap the elements individually.

Thank you Viktor,
Now that I placed the “:” on lines 28 and 29 - the whole program shuts down.

How do I unwrap the elements individually?

Thank you

Thank you Viktor,
Now that I placed the “:” on lines 28 and 29 - the whole program shuts down.

How do I unwrap the elements individually?

Thank you

You could Unwrap elementA and elementB instead of their input lists.

This has been discussed before, but basically you need to create a new list of unrwrapped elements.
something like:

unwrapped =
for i in IN[0]:
unwrapped.append(UnwrapElement(i))

you can define a function that does it if you need to unwrap multiple inputs efficiently.

or you can unwrap the element in the main function as well as @Nick_Boyts mentioned.

Then in order to have a good functioning joining node, you need to check if the elements are already joined and exclude those to avoid an error.
Also in the way it is written right now the node will return nulls even when the elements are successfully joined.If you want it to return booleans you need to add an aditional boolean list.

Hello Guys,
I tried unwrapping the elements two ways and now I get Empty List
@viktor_kuzev I added the switchJoin Order. Is that what you mean by adding a boolean list?
How come this script is not working for me and it worked on the “Auto Join Walls and Columns” Forum?


Thank you guys for your responses

No, I meant that the way you append your results will give you a list of nulls even if the joining succeeds.
You get empty lists because the JoinGeometry method requires 3 parameters - document, 1st element, 2nd element.
You’re providing only doc, 1st element.
And I still believe you need to unwrap the individual elements.
Good luck!

take a look at that topic:

Hey Hi,
Im trying to do similar way of joining duct hanger rods to ceiling

Is it ok to use this above code for my problem. I mean will it work for duct and ceiling?
PS: I dont know how anything in programming. just i can edit somehow

I had tried this. I guess it wont automatically join duct’s rod to ceiling. Im confused now :sob: