Set Z-value to Z-value of new list of points

Hi, I have 2 lists of point. First of them is list with level whitch have structure I need. Second list is same point list but with new Z-value. I need place new Z-value from second list to Z-value from first list, but XY coordinates must be match

So, the result of this script is a 3D polyline based on the source polylines, but the z-value is taken from the attribute tag of the source block reference.

I’m guessing there’s something you did upstream that split your logic where you could have kept this relationship intact and wouldn’t have to re-map, but we can’t say without seeing the rest of your logic.

Based on what you have now, the simplest solution might just be to create a dictionary. Deconstruct the xyz coordinates. Use the x and y coordinates as the key (join x and y as a string) and return the z coordinate as the value. Then you can use the same process to stringify the xy coordinates of your structured data and use the dictionary to return the appropriate z value.

1 Like

Hi Nick. This is 2 separate list created from different type of object. First one - is polyline vertex coordinate, second list is blockreference coordinates, but XY coorditantes is same because polyline verteces and blockreferences is realy had same coordinates. I will try to describe my logic in screenshot.

Finaly i get new 3d-polyline based on attributeTag from blockreference with new Z-value

You could match the xy values from both list and create a 3rd one with the correct Z value.
I would create a Temporary Tin surface with the points from the2nd list. Call the elevation value of the surface with XY coordinates from the 1st list (to keep the level structure) and create the 3rd list with the XY from the 1st and Z from 2nd


I used Arkance Systems nodes to reduce the inputs when it comes do create the TinSurface. CogoP, CogoG and TinSurf are deleted in the end.

Dictionary still seems like the easiest option.

3 Likes

it works !!! Thanks

1 Like