Group Cuboid by Size

Hey Everyone, have a list of cuboids that i want to group by size. It doesnt matter if the length matches length and width matches width.

As Long as element 1 has 3 number values that match element 2’s 3 number values thats what i want.

EXAMPLE:

Cuboid 1:
Length: 2
Width : 1
Height: 1

Cuboid 2:
Length: 1
Width : 1
Height: 2

Cuboid 3:
Length: 3
Width : 2
Height: 1

Cuboid 4:
Length: 1
Width : 3
Height: 2

Cuboid 5:
Length: 4
Width : 1
Height: 1

The Groups would be Cuboid 1&2, Cuboid 3&4, and cuboid 5 would be by itself.

I hope thats not to confusing. Please let me know if it is.

  • Extract cuboid length, width, height, and reconstruct a list with the three values as the sublist to each cuboid.

  • List.Sort the sublist (this would remove the permutations and leave you with combinations)

  • At this point, you can convert the values to strings and concatenate the sublist to get back to your original list size

  • Use the string list as the key to group.

2 Likes

Im confused after step 2.

1 Like

awesome! worked like a charm!

An excellent use of breaking things down to a simplified data structure and further reducing to a single variable. Great contribution!

2 Likes

Hey Robert, I was trying to do this same thing but on a larger scale. Where i have multiple boxes that are made up of multiple side peices. but the boxes overall sizes are different. i want to group the boxes that have matching side panels. and create a box type from that. so basically i want to add a level to this and compare all side panel sizes that make up the boxes so i know how many typical boxes i have

this is what i have. I am starting with the overall box (9 boxes total, 4 of these boxes are the same size) and the sublist has the panels that make up the box.

Please let me know if you can help me with this.

@Robert_Younger nvm! Got it! and just to let you know i have used this method you have taught me like a million times now!! really is a great way to filter data.