Edit a text file

Hi,

Please in Grasshopper go to “Display” tab and turn on “Draw Fancy Wires”. (just because it is useful)

Your VB component is reading “z” input as single item, but because “z” is a list of 4 items it is running 4 times in total, every time with the next item in “z”.
See the pic in my reply here: Get brep for checking intersect and performing boolean union and set “z” as “list access”.

Then, with “lines(i + 1) = (z)” you are replacing the item at “i+1” index (“C” in your case) with another item… instead, you probably want to insert ( https://msdn.microsoft.com/en-us/library/bb383995.aspx ) your items.

(maybe …Instead of “lines(i + 1) = (z)” , do a small for cycle to insert every item in “z” list in “lines” list. )