Sorting the elements based on parameter which i created

Hi,

I have a task that i cant get to work. I want to sort out the elements based on numerical order (ASCENDING) and i already created a parameter (“Location Identity”). In the above image, i want to sort my elements based on the parameter which i already gave. But while using filter by mask i got the elements based on right side highlighted numerical order.

Hi,

Could you show more nodes and more previews (the daata below the nodes), we cant see what element you are feeding the node

Do you want to sort after filtering?

What value are you sorting by? Note that strings won’t sort numerically but by ‘first letter’ so 9/2 will show up after 10/1 as 0 is lower than /. This means you might have to break up your strings and convert to numbers somehow.

forum.dyn (53.9 KB)
here i attached the dyn file for your reference.

I want to sort the family based on the parameter which i already provided.

In that case, the process would be this:

  1. Gather your elements. This could be done by all elements of category, all elements in view, all elements of type… whatever it may be.
  2. Get the relevant parameter value from the elements using an Element.GetParameterValueByName node.
  3. Use a List.SortByKey node to sort your list of elements by your list of parameter values.

If you want to add a filter, you do so before step 2 using the method you posted above - filter the list of elements, then use the ‘in’ output of the List.FilterByBoolMask node as if it was the gathered list of elements.

Thank you so much now its working fine