@jalwgis wrote:
I found a lisp program that adds the lengths of lines, arcs and polylines in inches. Is there a way to change it so the total is in feet and inches? ....
Presumably it adds them in drawing units. Assuming the total is in a variable -- I'll assume one called 'total' -- that can be reported to you in any format you like. If your current Units settings are Architectural, simply
(rtos total)
will give it to you in feet and inches, to whatever precision you have set. If your Units are something else, but you want it reported in feet and inches, you can force that:
(rtos total 4 4)
will give it to you that way [the first 4 is for Architectural mode], rounded to the nearest 1/8" [the second 4 -- change that for different precision].
Your routine may already include such a function, just with some other mode argument [likely 2 for Decimal units]. Read about (rtos) in the AutoLisp Reference, and also about the DIMZIN System Variable, which affects the output, whether 0 feet will be included if under 1', and/or whether 0 inches will be included if it's a whole number of feet.
EDIT: Your code post came in while I was writing the above. Change this line:
(prompt (strcat "\nTotal length is: " (rtos tot_len 2 2)))
to replace the first 2 with 4, and you can keep or change the second 2. [Or, if your Units are Architectural and your Units precision setting is acceptable, just omit both 2's.]
Kent Cooper, AIA