Help for list

Hello everyone

I’m looking to develop a dynamo script that will allow me to see how many people are in different rooms throughout the day (at one-minute intervals).
To do this, I have an Excel file with 3 columns

  • column 1: minutes
  • column 2: rooms
  • column 3: a number of people according to the minute and the room.

I can imagine varying the surface area of a family with

  • a parameter with the name of the room
  • a parameter with the number of people

To do this, I think I need to filter my values using a slider that will allow me to choose between the different minutes.

So I’m trying, after extracting my data from the Excel file, to keep only the values in the first column (which are in list0, so that I can use them as a filter.

Is this the right method?

After a lot of searching, I can’t seem to extract list0 and use it as a filter… see image

Thank you in advance for your help.
Daniel

It’s a little unclear what it is you’re trying to do exactly, but IN[00] is not correct syntax. I think you mean IN[0][0].

In order to filter values based on a selection (which I think is where you’re using the slider) you’d have to make some sort of comparison with the selection and the column you’re comparing against. Then you can filter the rest of the column values based on the key comparison.

1 Like

Thank you very much for your feedback
After a few tests and modifications, I arrived at the result below
Depending on the choice of minute on the slider, I get a list with the rooms and a list with the number of people. :slight_smile:

My next step is to manage to modify the parameters of a family in my project.
the family is called “Bloc Attente” (I’m french)
I need to assign the value from the “people” list to the “Effectif” parameter for the family whose "Numéro Attente


" parameter value corresponds to the value in the “Room” list

If you have any ideas, I’d love to hear from you :slight_smile:

Daniel

Best approach here would be take that data into a program like Power BI and actually visualize it I think. All Dynamo can give you is data to push into a model where you’ll be limited on a minute by minute basis on how to represent that data. Revit doesn’t understand how time works, really.

There are some addins that let you intersect Power BI with Revit models such as Tracer and Speckle. Maybe give them a look…

2 Likes

Thanks for this lead
For the moment, time management isn’t absolutely necessary: the minutes that appear in the table as numbers are just “text” and can be replaced by another expression such as “0h01, 0h02, …”.

After a few tries, it works well overall with the script below

New question: is it possible to configure the slider with LIST 0 values?

Thanks again for your help

Daniel

No. Unfortunately you cannot create a slider with custom values. There are two workarounds you can try but they vary in effectiveness and clarity.

Instead of a slider with the minute values, you can create a list of minute values and a slider representing the index to select. This is a little confusing in Player, because you need to explain which indices relate to which values.

The better option would be to use a custom UI like Data-Shapes to create the exact selection you need. This may be with a slider or it may be with something more direct like a dropdown list.

if you are using revit 2022 or later you could use a key schedule if the parameters are at room level values at list0 will ve your keys and the rest of the parameters will populate with the data you extract from the excel. what you need to do is create the key schedule in revit and in your excel file make sure you have only the data and no headers.

first row in your excel will be your key values