Dynamo, read by filter "Active cells only" from Excel

Hey all!

I am a new user to Dynamo and this will be my first post!
I wan’t to read an Excel file from Active Rows only!

If I filter my excel to only show a certain value, f.e “doors” (reading a large keynote file to set keynote value to categories in Revit). So if I filter Excel to show doors only, i want dynamo to read the “Active cells/active view only”.

I have tried to use the Bumblebee package - and “Range read”. But the range on the cells vary depending on what Category i filter on, f.e Doors might be shown in cells A1-A5. But if i then choose to filter on Windows they might be in cell A20-A25. And i don’t want to change the “Range read” in Dynamo everytime i filter in Excel.

As I said, I don’t wan’t to read by range unless the range can be “active cells only” or something like that… Is there any Dynamo / Python script who can solve this problem? Ty so much for your time!


Why not read the whole thing and then filter the results?


Because the whole thing is about 2000 rows with each row having 4-7 columns with different values. Reading everything at once makes in super messy.
Also, the text is in Swedish, so i have to make a python script who converts the IN text to revits language. F.e if IN = ‘Dörr’ outout has to be “doors” if IN = ‘Bjälklag’ output = “floors”. And I don’t want to type if and elif for 2000 rows.

So, is it possible to read filtered values only, from excel? :slight_smile:

if you need to type 2000 lines of if-else, it means you will have 2000 different types which I don’t think will be the case. Even if it did hit till 2000 different type in a single excel sheet, that also means that your data structure of storing is inefficient :slight_smile:
Like @JacobSmall had said, reading everything and filter by first row is the best option.
If you are concerning about translation, i got a quick workflow that you can use it as a custom node or in python script.

GoogleTranslator.dyn (17.7 KB)

1 Like

First of all, ty so much for the replies! And ty @stillgotme for that .Dyn!

The problem is that i need to translate to Revit language. I am using the “Category by name” node, so it has to be translated to Revit languague, f.e Dörr (Door) has to be translated to “Doors” and “Pelare” -google translater = (Pillars) has to be translated to Columns for Revit to know the Category. (Althought is is ALOT better then entering tons of “Ifs” :D)

The Xlsx file Contains 3 difference classification types (Swedish) And what i am trying to do is to match the Keynote param with another Classification called “BIP”. So if i Filter Excel for “Doors” i get the 4 Columns, with (Description, Keynote, BSABwr (production result code(swedish thing? :stuck_out_tongue: ) and “BIP”. I then want to find all “Doors” in current Revit Document, and match each BIP code to correct Keynote code.
And i don’t want to change the “Get by index” everytime i change the category, so Windows is in another index then doors, which means i have to change the getbyindex everytime i filter (I wan’t this automated by reading active indexes only).

Bipkoder.xlsx (120.1 KB)

This is why are are encouraging you to instead of asking for the user input in Excel, try using the user input in Dynamo. Pull the list of all unique categories, have Data shapes pop up a UI asking ‘which category(s) do you wa t to work with? Select all that apply.’ And go from there. Reading a consistently changing value based on a non-static link to a 3rd tool (Revit, Dynamo, Excel) is asking for problems.

Aha, I have to look into Data Shapes, haven’t used it before (I’m new to Dynamo). But if that makes me able to read the entire xlsx och then only work with the Categories from which i Enter in DS UI, it would be awesome. Ty so much @JacobSmall

1 Like