Guys, I have an output of sublists, where their quantities can vary a lot and I would like to automate the process of getting the values of the separate sublists.
The image below shows how I’m getting it manually, but the amount of these sublists can vary and I didn’t want to have to keep coming every time I had to put another line in the codeblock so I could get a new separate sublist.
Can anyone help me?
The truth is this is probably unnecessary. If you’re doing specific things with the lists then the index would be important. We need additional information as to what you’re trying to do, but you can probably handle this with list levels instead of pulling everything apart.
Each sublist of that will be parameter values that will be populated in parameters of different categories of elements in Revit.
And these sublists will be coming from an excel spreadsheet and they will always be able to vary their amounts.
Each prefix of this is to represent a certain set of parameters that will be inserted in a certain category of Revit that I want to insert them.
Assuming the parameter name is the column, you can do this directly with list levels, no need for any form of list indexing at all.
If the columns are not the parameter names, you can map them to parameter names the same way the person who filled out the excel file knew what info to put into them.
In fact, this list is not the parameter names, but the parameter values.
Values that contain TEST prefix, will fill parameters of a certain category, where each value of each row goes to a different parameter of an element in the category and values that contain TEXT prefix will fill parameters of another category of elements and the person who going to send me this worksheet has no knowledge of Revit.
Think that this list can contain about 100 values that will fill parameters of different categories of Revit.
Did you understand?
Where are the values coming from? How is the data structured in excel?
I created a random test example here, where each prefix represents a single set of parameter values that will be input in different places and think that I can receive this spreadsheet always with possibilities for changes, with new prefixes that will represent different parameter sets
GDS_-Exemplo_v00-_20220611.xlsx|attachment (9.9 KB)