# How to classify by two contain conditions? length and area

Dear all,

There is a question about how to classify data in GH, ex: when I classify the panel by area, how can we add another condition such like panel surface girth, Just like in kangaroo, we can add differents conditions components ( angle, length, area etc.)

Because in many cases, if only according to the area of the classification, some different panels will be classified into one group, because the area is the same.

Best!

According to your screengrab, it seems like a rounding and area coordinates issue, not about the areas themselves and other conditions relatedâ€¦

Hi Kim, Thanks for your reply, the last screenshot was no problem(just some display bug), in fact, my main question is that, how can we add second or third conditions to classify the panel to be more precise.

For example, these panels must meet the same girth and area at the same time to be classified into one type, if not they are differents types.

If you have two different conditions, for example, Area & naked edge length, then you can simply add up the whole condition results(using Mass Addition)and round the results within some tolerance and finally, you can compare with each otherâ€¦

Panel Classify _01.gh (29.7 KB)
But If just simply add up two numbers to classify, it doesnâ€™t seem to be rigorous

There are 6~8 different types of panels depending on how you would set the tolerance.

Panel Classify _01_re.gh (28.6 KB)

Hello, Kim, thanks for your program, but I found that this algorithm may have some bugs. For example, the two completely different panels below will be divided into one category. For example, the area of the A board is 9 and the circumference is 11 , The area of the B board is 10, and the circumference is 10, then they will all be divided into the group with a total of 20. â€¦

The good news is that this (general case: any combo of conditions imaginable) is addressed via a suitable custom Type class (where Properties describe your conditions) and then do the clustering via a trad LINQ GroupBy query (or via some nested queries) .

The bad news is that youâ€™ll require coding.

1 Like

using System.Linq