Join elements in a specific order

Hi there,
I’m an architecture student moving my very first steps into Dynamo, indeed it’s been a few days since I discovered its existence even if scripts are not one of my “mains”.

I was looking for one able to help me join geometries that intersect in a specific order. I found this by Ammo that came really handy in order to just join intersect geometries ( Auto join Elements - #10 by ammo ) but I was not able to make it do it in a specific order such as shown in this thread ( How to join and dissalow join different elements - #14 by trezatreza ).
[Just to be more specific, if I join slabs with beams, I want slabs to be joined with beams that intersect them in this specific order slab-beams, not randomly; and of course the otherway round if I need to]
Can you please teach me how to do it?

Thanks in advance for your help, I’m trying my best to learn few but essential steps in Dynamo so if you have any suggestion/book/course to start with I’d really appreciate.


Hi @George.9,

Welcome to the Dynamo community! :slight_smile:

Could you maybe share some screenshots (and maybe a file) from what you have right now and what you would like to achieve.
Also if you could explain how to want to join the objects, and what your goal is? I’m sure we can help you out.

Kind regards,

Hi @Daan,
Thanks! :slight_smile:

I’ll try to make myself clear as much as I can. I’m looking for a script to make join elements of two categories that intersect in a specific order (e.g. if I join slab and beams, I want the slab to cut the beams; viceversa if I switch join).

I only found ways to make elements that intersect join in a random order and I thank Ammo for this because his workflow from this post ( Auto join Elements - #10 by ammo ) joins interesect elements very fast in my project.

I was not able to figure out the switch join order thing.
I’ve read tons of post on this forum, watched tutorials without any result.

Sorry if this question might seem stupid, I’m trying to learn as much as I can about Dynamo and I’m doing my best. I would really appreciate any advice.

Thanks in advance for every minute of your time,

Here is a code for Python to switch join
this might help.
You need two inputs for this code (floors & beams in your case)

import clr
from Autodesk.DesignScript.Geometry import *

import Autodesk

import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

import Revit
# The inputs to this node will be stored as a list in the IN variables.
dataEnteringNode = IN

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

doc = DocumentManager.Instance.CurrentDBDocument

results = []

for A in elementA:
	for B in elementB:
			result = Autodesk.Revit.DB.JoinGeometryUtils.SwitchJoinOrder(doc,A,B)			
# Assign your output to the OUT variable.
OUT = results

Hi @Hyunu_Kim
Thanks for this Python code but I guess this just switches the casual join order that the join script gave. I am looking for a way to have a specific order between two intersecting geometries and decide which one cut the other (e.g. all beams cut slabs or viceversa, not some of them cut slabs and some of them are cut by slabs).

Hope I made it clear,

unjoin floor&framing → join intectects(now floors first in Revit rule) → switch join (then framing first)
I’ve never try this but it could work theoretically.