I know Autocad doesn't have a command to get the total length of lines out of the box, but does it have a command to show the difference of 2 lines (or polylines) so you don't have to list the lengths and use the calculator?
Solved! Go to Solution.
Solved by Kent1Cooper. Go to Solution.
Nothing built-in that I know of, but programmable easily enough [lightly tested]:
(defun C:LENGTHDIFF (/ len ss)
(defun len (x)
(vlax-curve-getDistAtParam x (vlax-curve-getEndParam x))
); defun
(prompt "\nTo get the difference in length between two objects,")
(if
(and
(setq ss (ssget '((0 . "*LINE,ARC,CIRCLE,ELLIPSE") (-4 . "<NOT") (0 . "@LINE") (-4 . "NOT>"))))
(= (sslength ss) 2)
); and
(prompt ; then
(strcat
"\nThe difference in length is "
(rtos (abs (- (len (ssname ss 0)) (len (ssname ss 1)))))
"."
); strcat
); prompt
(prompt "\nMust select exactly 2 objects of finite length."); else
); if
(prin1)
)
That reports the length difference using whatever your current linear-measure mode and precision are, but it could be made to always use specific settings for those.
Can't find what you're looking for? Ask the community or share your knowledge.