Value Filtering

I am currently looking to extract the distance between piles to dimension the piles.
In doing so, the following logic is used to filter the line segment.

  1. Use Line.ByStartPointEndPoint to join all coordinate combinations to create a line segment.
  2. Sort the created line segments in order of decreasing length using List.SortByKey.
  3. List.GetItemAtIndex to specify a value to be taken from a list of line segment lengths.
  4. List.FilterByBoolMask to extract line segments with the same line segment length as the specified value.
  5. If there are interfering line segments, leave the original.(Python)

However, when filtering a line segment by the specified value of 3000, it does not work as expected.

There should be more than one line segment that corresponds to the specified value of 3000 distance, but only one is retrieved. How can I solve this problem?
I have also attached the file, please check it.
PileDistance.dwg (1.4 MB)
PileDistance.dyn (41.0 KB)

Part 1 - Use List.Combinations instead of cross product when creating lines from points
This removes the coincident points so you no longer have to deal with the nulls and python script

Part 2 - Do your rounding before sorting
image

Part 3 - Dealing with multiple selections. When you filter based on multiple choices you have to recombine so that the number of the mask list is the same as the object list. Use list levels and a List.AnyTrue to check
image

Result
image
PileDistance.dyn (35.3 KB)

4 Likes

This is exactly what I wanted to do.
Thank you so much!! :slight_smile:
I had never heard of the function of the List.Combinations node.
Until I learned about this, I had solved the problem with an external product or python.

1 Like