hexagon logo

Finding top 3 values

Is there a way to set up a code to extract the largest 3 values of a group of hits?

I have 9 points around an arc and want to create a circle using the 3 largest values from the 9 points.

I'm able to get the Max/Min values from the group, but want a way to find the three largest values.

Thanks,

Parents Reply Children
  • Try the code above for right now, I'm working on something. When arrays get too long you can't fit them together. And I forgot how to get 3 arrays to be considered as individual values. Here's the shorter version. Change your statements to whatever your feature name is.

    ASSIGN/V1=ARRAY(SQRT((1CR1.HIT[1].X^2)+(1CR1.HIT[1].Z^2)),SQRT((1CR1.HIT[2].X^2)+(1CR1.HIT[2].Z^2)),SQRT((1CR1.HIT[3].X^2)+(1CR1.HIT[3].Z^2)),SQRT((1CR1.HIT[4].X^2)+(1CR1.HIT[4].Z^2)))
    ASSIGN/V2=ARRAY(SQRT((1CR1.HIT[5].X^2)+(1CR1.HIT[5].Z^2)),SQRT((1CR1.HIT[6].X^2)+(1CR1.HIT[6].Z^2)),SQRT((1CR1.HIT[7].X^2)+(1CR1.HIT[7].Z^2)),SQRT((1CR1.HIT[8].X^2)+(1CR1.HIT[8].Z^2)))
    ASSIGN/V3=MAXINDICES(ARRAY(V1[1], V1[2], V1[3], V1[4], V2[1], V2[2], V2[3], V2[4]))
    ASSIGN/V4=SORTDOWN(ARRAY(V1[1], V1[2], V1[3], V1[4], V2[1], V2[2], V2[3], V2[4]))
    MAXINDICES just tells you which hits are the highest value if you mouse over the assign statement

    SORTDOWN tells you their exact Polar Radius so you can verify that their values are for certain the highest

     Let me know if you need more help. I only did 8 hits because character limits, and didn't wanna add an extra variable for an example.