Delete part of a list by writing in string?

Hello!

Does anyone know how I can delete parts of this list by writing what parameters i do not need? For an example if i need to remove the RevitID from the list, I would like to have some sort of string that lets me write “RevitID” and then creates a new list without the parameter. My end goal is to have a Revit interface which lets me choose which parameters i want to include and exclude :slight_smile:


List.IndexOf and List.RemoveItemAtIndex. Careful with values of -1 in the index of which I recall can occur when looking for something that doesn’t exist in the list, as that may remove the last item.

As I can see the List.IndexOf has to be based on the parameters of a specific element. I have a lot of different elements with a lot of different parameters, so I need it to be based on a parameter instead of an element. In best case writing in a string, which excludes the parameters from the string(s) :slight_smile:

Sounds like you want to use Data Shapes to create a custom UI using a ListView to allow you to provide all possible values as a list to be selected. Then the user would select (or deselect) which values to include moving forward.

Not really - you can pull all the parameters as you are now and leverage list lacing and levels to manage the exclusion. Just be sure to work the list at level two and keep the list level (so @@L2).

Hmmm… I dont think I understand that. Which node would I have to use as “element” in the List.IndexOf? If I… lets say… want to remove the IfcGUID parameter from all my elements? :slight_smile:

Thats sounds interesting I will have to look futher into that! :slight_smile:

Try ‘RevitId’ or any other parameter name.

Hello again. Should RevitID be connected to “elements” in the node List.IndexOf? And should it be all elements connected to it, because what I need is to delete certain parameters in the different elements?

I’m lost… you said you wanted to remove some items from a list - List.IndexOf and List.RemoveItemAtIndex will do that.

If you’re after something else I’d need more insight on what that is.