Sort one list to 4 lists or more by range index value

Hello every one
If i have some lengths in only one list and i want to sort that "one list " to " 4 or more lists " according to the value of each length , and give each group of lengths a specific name

for example : this is my list ( 150 , 200 ,250 ,300,350 ,400 , 450 , 500 , 550 , 600 , 700 ,800 , 900 ,1000 ,1150 , 1200 , 1300 , 1400

)

and i want it like below lists
1- list from 150 : 500 ( 150 ,200 ,250,300,350,400,450 )
2- list from 500 : 700 ( 500 , 550 , 600 )
3- list from 700:1000 : ( 700 ,800,900,1000 )
4- list for more than or equal 1000 :(1000 ,1150 , 1200 , 1300 , 1400 )

How about this :wink:

2 Likes

@mostafaessam Kindly mark as Solution if it solved your problem so that others could directly view the solution post . :slightly_smiling_face:

thanks nissal for your help ;
it is logically correct and smart . but there is some thing wrong in (List. filter by boot mask ) node

and this is description of filter by bool mask issue

check few things,
if there is any empty set in && node?
do you need any levels to put in List.FilterByBoolMask? (Either list or mask or both)

1 Like

Do you have any empty list or null value in Element.GetparameterByName?

1 Like

Dear Nissal ;
thanks for your support , and sorry for delay to reply , i was so busy last days

Actually in All elements of category list , there is no empty or null item
but in get parameter value by name , there is empty items
and when i use clear list to delete empty or null items , it give me same list without any delete

i think the problem is that in All elements of category list it have " Round duct " item ( BTW i am try to make that list for duct "rectangular not round " to classify all section by its Gauges ( according to its size of width and height )

diameter value of round duct should not be there , and actually it is not there , but in its list index , it is empty . great , lets use clear list to delete empty items . surprise , it is not working because there is an item but its value is diameter not width or height

Filter the list of diameters or filter elements in FilterByBoolMask. Do this filtering in the beginning itself.

Uploaded the same sample file. This will work out.
list numbers.dyn (44.6 KB)

1 Like

yes , it is now working
Thanks Mr Nissal

hello Nissal ;
there is another problem in that script
after i classify all of my duct ( width & height )
i want to get another parameter of select sizes , the new parameter is " Area "
i used get parameter by name node , but input of that node "element " does not accept filtered list
i do not know , what is the problem exactly
i think i should convert "double " list to element list , but i do not know how

the thing you did for taking out area values is wrong.
Get parameter requires elements but you are filling list of numbers.

this green line comes are All elements of category node
This will give you the complete list of areas

OR Are you looking for this way?

You need to parallely get list of elements and sort it using filter by boolmask.

1 Like

Dear Nissal ;
thanks for your collaboration ;
Acually i need the second option ( area of only filtered elements )
you can find image as attached , and also Dyn file

Dyn file
Duct area per Guage.dyn (76.7 KB)

I have modified as per 2nd option. im not sure how it will work since you took 2 conditions - width and height.
I have kept both the results. compare both the results of Area.

Duct area per Guage.dyn (82.4 KB)

Dear Nissal ;
same problem also , double input instead of element input in "get parameter by value " node

Sorry i made a slight mistake. now check you will get list of specific elements. this element list would be for 0-300.

If you want for other range. copy paste the red and yellow group, as per your requirement.
Duct area per Guage.dyn (87.6 KB)

1 Like

thank you very much Mr Nissal
i really appreciate your patience & collaboration

1 Like