@Anonymous wrote:
.... modify it to be able to get all of the columns in the attached word document filled? ....
Not without some more information about what those categories need in them. But you can probably work it out from this start. It assumes sequential numbering for the Feeder ID, and uses the cumulative distance along the overall Polyline at the vertices for the "Run Start" and "Run End" for each segment, but that's also just an assumption -- maybe you need a location or something. I had no idea what to assume about the # of Turbines, but maybe you can figure out what to put there instead of my "whatever".
(defun C:PSLE (/ pl psle n); = Polyline Segment Lengths Export
(setq
pl (car (entsel "\nPolyline for Segment-Length Export: "))
psle (open "C:/PSLE.csv" "w")
n 0
); setq
(write-line "Feeder" psle); top line
(write-line "ID,Run Start,Run End,Length,# of Turbines" psle); headings
(repeat (fix (vlax-curve-getEndParam pl))
(write-line
(strcat
(itoa (1+ n)) "," ; ID
(rtos (vlax-curve-getDistAtParam pl n) 2 6) "," ; Run Start
(rtos (vlax-curve-getDistAtParam pl (1+ n)) 2 6) "," ; Run End
(rtos ; Length
(abs
(-
(vlax-curve-getDistAtParam pl n)
(vlax-curve-getDistAtParam pl (setq n (1+ n)))
); -
); abs
2 6
); rtos
","
"whatever" ; # of Turbines
); strcat
psle
); write-line
); repeat
(close psle)
); defun
Kent Cooper, AIA