Remove and replace coordinate pairs only

Need to be able to remove all the pairs of Z’s (Z CHANGE) in the attached file then insert text, but any line with the single Z change needs to remain unchanged

Please help

Z Change Pairs (9.8 KB)

Z Change Pairs test Edited (16.9 KB)
This should have been done in C or Python.

Choose Multiline Data to make the text into items.

1 Like

@Quan_Li Thank you so Much! … I started learning Python, but I’m only a few weeks in, if you know how to do this in Python I’d appreciate it if you could show me.

@Quan_Li one more thing … how do we modify this do so if there are multiple lines of text each line of text gets its own indices?


Z Change Pairs (22.1 KB)


Is this what you are looking for?

20230427_Z Change Pairs (12.4 KB)

@michaelvollrath, this almost works, 1. the result needs to be multi-line data (unfortunately I didn’t show that in my original post), Thomas E’s response is the result I’m looking for.

No worries! Even though Thomas solved it via C#, here’s the multiline version with vanilla grasshopper nodes only, (the flatten paths to text stream group is disconnected):

20230428_Z Change Pairs (12.1 KB)