How to exclude rooms based on roomnumbers?



i want them to exclude from my collected rooms

how

the issue is i have 810 values but 820 rooms when i set the parameter i mess up the whole

PyImportExcelBasedOnRoomNumber_V04.dyn (75.4 KB)

… i solved it with deleting the rooms in the excel…

is there a better way

Issue is that the excel roombook ist 2 years old and these 10 room changed or got deleted…

how to match xls with Revit ?

This is just another form of the common “match excel with Revit data” problem. A dictionary is the easiest way to handle all scenarios as it handles the matching as well as any “mismatch” between the datasets.

3 Likes

Unless you do include the UniqueId of the Element in the Excel file So my dictionaries go by UniqueId and something else Then use GroupBy"Something" . Works smooth in every Revit version
SelectByUniqueID and do what you would do in the Revit UI, only faster.
Unplaced Rooms would be my first group to exclude in this example

1 Like

Maybe I misunderstand the issue… but wouldn’t a simple loop in Python work?

If this code is in my bad list then ignore the room…
Otherwise… collect the room in my output list.

2 Likes

Exactly that but with the standard nodes, no need for Python

1 Like

I rule - :snake:

1 Like

image
He rules

2 Likes

:gun: :snake:

1 Like

I’m not a programmer, don’t need it, be creative

2 Likes

That’s like saying you don’t need Dynamo because you use Revit!

Looping in Dynamo is painful…

Think maybe we have gone a little off topic here though.

1 Like

Its off topic, sure
It is wise to stop
I don’t need looping btw Its just another way to build a dictionary

2 Likes

Work? Yes. Efficient? Not at all.

Say I told you to find the definition of Zyzzyva.

Using a loop, the statement is basically this:

  • for each word in the dictionary:
    • check if the word is Zyzzyva
    • If so
      • return the definition thereof
      • stop the loop
    • Else continue

If you thought to include a statement at the end of the loop the average is 250,000 tests per word.

With a dictionary you just ‘go to that word’, seeing as Zy is going to be late in the sorted set of entries it should be quite quick to find.

That said, if it works they go for it. :slightly_smiling_face:

2 Likes

I think your roomnumber list from Revit can easily be compared to the excel list. As long as the roomnumbers are exactly the same, and only some rooms are missing in the excel OR in Revit it doesn’t matter.


(in this example I removed the k## rooms (basement))

Or instead of List.GetItemAtIndex you use List.RemoveItemAtIndex

You just have to make sure that the Inputs from Room numbers can be an exact match

@RevitRobot

yes, i think when i not “contiune” i have some kind of missmatch, so i cleaned the excel and now the right line in excel finds the right line in Revit… i wan`t to investigate this topic more, have no time.

i had also duplicated roomnumbers, and cleaned that too…