Inspecting sublists individually

I have created a list with sublists of Revit elements and I need to compare parameter values within those sublists, so essentially I need a loop that picks the first item of the list then compares parameter values in the elements in that sublist, finds an error, writes in the error parameter and moves on to the next sublist. (I need to check if the parameter valies are consecutive letters)

I feel like this is super simple and I am just unable to search it the right way.

Will the values always start with A or could they be any set of consecutive values?

I’m not sure I exactly follow. But here goes. You want to.

-Check a list of list
-Get parameter from the element of the list of list
-Set that parameters on thoses lists

Where you start with a parameter list of
[ [ A, B ], [ B, A ], [ A, B, E, C, D ] ]
and change the parameters of the elements to
[ [ A, B ], [ A, B ], [ A, B, C, D, E ] ]

?

@Nick_Boyts should always start with A

@slepagetrudeau i need something universal, both lists are of undefiend lengths

So what’s happening if the values aren’t consecutive? You wan’t to set them to the proper letter or just return a boolean or something stating that they are incorrect?

If the values A, B, C, are always refering to the same item, how about making it into a dictionary to create a key to sort your list in the right order?

LunchBox dependencies

DynForum_kvelevaDynForum_kveleva.dyn (11.7 KB)

@Nick_Boyts i want to write “Error” in and Error report parameter if there is a sicrepancy

If you just need to determine what is in the correct position and what is not you could do something like this.

Easy. Just take the the true/false outputs from my previous image and create an If function. If the character is incorrect (false) write “Error” if everything is ok (true) write "null’ or empty.

I am struggling to understand how those things work.

I have gone trough a large list of doors and collected the toRooms numbers for each door; then i have grouped those that are duplicates, ie where more than one door opens into the same room, and then i want to check if they have the adequate label (seperate parameter to the door called “Door label”) to create the correct door number - ie to room 1 - Doors 1A, Doors 1B ect. (don’t even ask me why the door numbering is set up like this, i have to work with what i’ve got.)

Which part are you struggling with? It sounds like you have your doors grouped by room and you can get their labels. That’s a good start. Can you post an image of your graph?

So,

-Get the door’s parameter and check if a room with 3 doors have them numbered A, B and C.

-If the doors are badly numbered, say, A, B, C, D, Z, set an “ERROR” parameter in that specific door. The Z door. because it expect a E.

-Alternativly, you could also make it set the expected letters on wrongly named doors. Or both. I see you have 531 doors.

1 Like