Comparing XYZ of Points

So I have a single point and then a list of several points. I want to compare the first point to see if it matches any points in the list. If I run a simple ‘==’ function it runs true on all outcomes as it reads the fact they are all points not their XYZ location. I could extract individually the X, Y, and Z of the point and the points in the list and then run a compare on each. Problem is then how do I feed this information back in where X may be true in every case and then Y true in 2 cases and Z true in only case. I need a method that picks out the index where it reads true, true, true across each axis.

This got me thinking of ways of comparing the whole XYZ location at once. So I converted the numbers to string which allows me to compare the whole number across the numbers in the list. This works perfectly for what I need however I have come unstuck again. If I have a situation where im feeding in more than one point and want to cross check them all, if I convert to string it will obviously combine the all the numbers in the list into one. How can I run a compare on several points without having to call them out individually? The string remove is just removing the { } from the string. Maybe the initial way I started was a better method. Any ideas…?

Capture

My mistake… If I run the compare through the list.map node it works how I want :slight_smile:

Okay stuck again! If I have a nested set of lists, with true and false values. How can I go through the list and pull out the index number of all the items that are true. I have tried the ‘If Equal Return Index’ custom node but it seems to return an empty list every time? The code block on the right shows the outcome I wish to achieve.

Capture

Is this what you’re aiming for?

2014-09-10_092407

Hi Dimitar - no not quite. I wish for it to list the index number of every instance where it says true. In your example the end list I would expect to see is the one below.

Capture

I’m not sure how this could be used exactly, but hopefully it solves your problem:

2014-09-10_171049

 

 

 

 

Drat now you got me really interested :smiley: . Do you mind sharing what your process and end goal are?

Dimitar you beauty! That’s exactly what I needed. Wonder if you could elaborate on the latter part and explain what is happening? Here is my example mixing it around to check it still functions…and it does! I will show you my end goal once I have reached it. This is a very useful tool though :slight_smile:

Capture

 

Dimitar,

Below shows what I wanted to achieve. In a nutshell:

  •      Extracting XYZ of analytical nodes
    
  •      Extract Revit ID of analytical nodes
    
  •      Push this information back into Revit for scheduling
    
  •      Extract start and end points from the curve used to create structural framing
    
  •      Compare this to the node points finding instances which match
    
  •      Plug in the Revit ID for the nodes into a parameter in the framing family
    
  •      Finished article: Have two schedules one for analytical nodes and one for structural framing members that can reference each other
    

Capture

With the help of the Map node, the Count node gets the total length of each sub list.

That number is reduced by one because lists in dynamo start from 0 and then it is fed into a number sequence (which again starts from 0) to match the list indices.

Finally because you’ve already defined a conditional statement, we can reuse that conditional statement to filter only the list indices that match your predetermined conditions.

 

Good job with mapping the analytical nodes to the beams. I guess this can be used to insert the forces from a structural analysis directly into the nodes?