The pseudo code is simply to select a polyline (no bulges I hope),
extract the vertex points and send them to the select-by-fence method.
Before that, change the point style and size to determine the fuzz factor
of which points are close enough to be selected. Then extract the
coordinates of each point selected and write them out to a comma-delimited
.CSV file.
Now bear in mind that the selected points will create an alignment
different from your polyline because they won't be exactly on any segment
of your simplistic polyline. But if you want that, then we could add a
little code to adjust their location to be exactly on the polyline before
we write out the coordinates.
You should also think of naming each path, maybe with the layer name of the
selected polyline, so that the file would look like...
E-BUILDING
x,y,z
x,y,z
etc.
That way you could actually select multiple polylines and have all the data
written to one file in one shot.