I had to use the Open function to create the text file and name it as rivers_Mfelde. In order to get the coordinates, Name, and Object IDs to the text file, I had to create a for loop to iterate over all the rows. Next, I needed to do another for loop to iterate each point in the array. I use the .getPart() method to access the points in the array. I had to add 1 to the vertex ID to help keep track of the vertices.
To get the data in the text file, I had to use the .write() method. I used the iterate of the first for loop, the vertex ID, X coordinate, Y coordinate, and then the name of the river. To ensure that I captured everything correctly, I printed the results as well in the interactive window. I closed the text file.
Below is the screenshot of my text file along with a flow chart that shows the process of creating the script.
Text File Results |
No comments:
Post a Comment