How to get list of surfaces w/ maximum area?


#1

fairly simple issue but i’m stuck here


#2

Notice your item at index [0][0] for the surface area and index [0] don’t match. This is because you’re working with a float which is less stable.

Round your values before you get the maximum value so that you’re comparing integers instead to prevent this.


#3

Or sort them (ascencing order) and take the last item of each nested list.


#4

thanks all, seems both rounding and sorting doesn’t work, but my logic (of list handling) is correct, right?


#5

I think that @alvpickmans said is something like this:


#6

right, it works, thanks.
but how to get the index from original list? in fact, i just want to get the face list w/ maximum area, not area itself


#7

Try to change the “element” input of indexOf node to @L1


#8

not working, warning: argument is invalid


#9

i used another method, seems working now


#10

@tiagocorradi - what Dynamo version are you using?


#11

1.3.2


#12

Auto lacing isn’t in the supported 1.3.2 though… unless I missed something.

image


#13

no auto lacing, but my Dynamo is most updated, isn’t it?
image


#14

ah! I asking @tiagocorradi, not you @Ning_Zhou. Sorry for the confusion.

These are the two methods discussed above working off of a simulated data set. The idea behind the math.round is to prevent the bad data reads which can happen when pulling Revit data and converting units.


#15

right, float value is always dangerous, thanks and have great weekend!


#16

What is auto lacing? I have never seen it before.


#17

Something which appears to only have made it into the daily builds. I’m not yet comfortable enough to speak on it. Perhaps someone else more familiar will speak up on this, but might be best to wait until it’s commonly available before you start to worry. :wink: