Sorting / copying Revit rooms into the linked model with xyz

Hello everyone, I am facing the following problem.

I can’t manage to assign the rooms from two models, i.e. 1x main model + 1 linked model
to assign the rooms via xReference. The bottom line is to check whether “Room 1 with coordinate XYZ” already exists in the linked model, if not I want to place or copy it.

  • There are 2 Revit files 2023 Area statistics and architecture model
  • The architecture is linked to the area statistics model

I am now so far that I can read the rooms from both models
and also see the coordinates (points with XYZ). However, I am not able to compare the lists of building 1 (8 rooms) with the list of building 2 (4 rooms).

To have the same number of objects (if you need that at all)
I used “list.count” and filled it with “list.ofRepeatedItem”.

It looks like this

List 1
1 Point XYZ
2 Point XYZ
3 Point XYZ
4 Point XYZ
5 Point XYZ
6 Point XYZ
7 Point XYZ
8 Point XYZ

List 2
1 Point XYZ
2 Point XYZ
3 Point XYZ
4 Point XYZ
Placeholder
Placeholder
Placeholder
Placeholder

The image also shows how the xReference should take place

With “list.combine” the evaluation works but here only line 1 is compared with line 1 but not the xreference so that the same object information is searched for.

If anyone can help I would be very grateful.

Hello!

If I understand this correctly, you want to get a list of rooms and if the room in the linked model shares the same location point as the one in your main model you want to ignore them and only have a list of the rooms that do not have a companion?

Maybe this?

image

Here’s one thought on solving it, make use of a dictionary, the output is the rooms that have a “false” bool in your original image.

I’m using the rooms location points as you have it, but this might not be a reliable method to use if you run into situations where a room you want to ignore is slightly off from it’s companion. Could you use a property like the Room Name + Room number?

Hello everyone, sorry for the delay in replying,

I have now been able to solve the problem.
I use the node ‘list.cartesianProduct’
to sort the lists according to an xReference.
I was then able to continue after I had the correct associated rooms.
Now rooms are read from the linked model also their position (pythonscript) and opened model is created if the rooms are missing which are present in the linked model at the same position.

What I might want to replace is the python script, are there standard nodes (no attachments) to read the rooms with the position from a linked model?

Problem is python is version dependent and many things can change.
In addition, the company that works with the script is also very limited in terms of plugins, addons, etc…