# Sorting and Combining Lists

I’m going to try to state this as simple as possible but I’ve been thinking about this for a while so I might ramble…

I have two lists and I need to sort the lists. List A holds values and I need to sort them by List B.

To demonstrate this better imagine I have a surface assigned to Item 1 of List A and it corresponds to Item 1 of List B (and this continues for all 400+ list items). I need to filter the list by list B.

In the picture you’ll see that items 0 and 1 need to be filtered into a ‘Midrise 1’ list. Items 2, 3, and 4 need to be filtered into a ‘Midrise 2’ list. From there I need to isolate the items in the ‘Midrise 1’ list and the items in ‘Midrise 2’ List.

Does anyone have any idea how to filter/sort these?

Being in the developer section i’m assuming you are looking for a coded solution vs grasshopper?

Personally i would use Elefront for this, although there are native solutions, most likely with cset.

If you post your surfaces i can demonstrate vs making up something that probably isn’t what you are particularly looking for.

I thought that the coded solution would be more practical in this solution. If item in List B = Midrise 1 than the same index number goes into List 1

So I have 3 buildings, within these 3 buildings there are a variety of different program types (hence the color). I need to take the building on the left and count the area per program type. It should be noted that this is a custom scripted program that uses grasshopper to compute and report data. Is this making any sense?

Seems pretty straight forward. Easily done in grasshopper. You may need to provide more info about the structure of your data if looking to interact with your custom scripted program, nothing is going to be practical if only part of the info is provided.

We had the coding part of this program outsourced so I don’t know how it operates 100% but I do know how it works in theory.

• Design surface in rhino to create a programmatic floor plan. Assign extrusion heights to each surface to generate the building look (the extrusions are just there for visualization for this instance).

• After the floor plan is generated, assign it to the building parameter and the program parameter on the right (see image 1). This assigns it to a category that is reads information about the surface (ie: area, perimeter length, height, etc).

• After everything is assigned appropriately you open up grasshopper and create the node that reads the information (see image 2).

For my purposes I need to filter the data by building. Alcove in Midrise 1 has X square feet and so on. How would I go about filtering the data by building.

Image 1:

Image 2:

Can you add Area to the Group outputs? or get it from the Geometry output?

If not you are going to have to query the Rhino Geometry most likely. The data you are seeing is stored as UserText.

You can group these outputs as is via CSet or MatchText. Doing so several times if you are looking for particular filtering.

This is less practical than using a plugin such as Elefront or Human to query the geometry/usertext. I’m not sure what the coding options are in this case.

I figured it out and that’s pretty much exactly what I did. I set the search up to scan for a certain member name, and took the number index from there. Assigned the number index to List A and boom. Got what I needed. Sometimes it just takes some talking through it. Thank you for your help!!

1 Like