Something like this, in simplest terms:
(defun C:WHATEVER (/ ss refline rldata)
(if
(and
(setq ss (ssget "_:L"))
(setq refline (car (entsel "\nLine to serve for Reference length: ")))
(member '(0 . "LINE") (setq rldata (entget refline)))
); and
(progn
(ssadd refline ss); in case it wasn't in selection
(command "_.scale" ss "" (cdr (assoc 10 rldata))
"_reference" (distance (cdr (assoc 10 rldata)) (cdr (assoc 11 rldata))) pause
); command
); progn
); if
(prin1)
)
You can type in the new Line length as you describe, or pick on-screen. It assumes you want the selected Line Scaled along with the rest, even if you didn't select it along with the rest, but you can remove line 9 if that's an incorrect assumption.
It could use all the usual improvements, could Scale about the downstream end or the midpoint of the Line instead of it upstream end, and could notify you if you didn't pick a Line for the Reference length [instead of just quitting], and so on.
Kent Cooper, AIA