This should get you started. Question two is entirely possible, it's just too late to work on anything else...
Code:
;;; Total length of selected Arcs, Lines & LWPolylines
;;; Value is printed to screen and stored in system variable "UserS5"
;;; Alan J. Thompson, 03.20.10
(defun c:TL (/ #SS #Len)
(vl-load-com)
(princ "\nSelect Arc, Line, LWPolyline object(s) to calculate total length: ")
(cond
((setq #SS (ssget '((0 . "ARC,LINE,LWPOLYLINE"))))
(or *AcadDoc* (setq *AcadDoc* (vla-get-activedocument (vlax-get-acad-object))))
(setq #Len 0.)
(vlax-for x (setq #SS (vla-get-activeselectionset *AcadDoc*))
(cond ((eq (vla-get-objectname x) "AcDbArc")
(setq #Len (+ #Len (vla-get-ArcLength x)))
)
((vl-position (vla-get-objectname x) '("AcDbLine" "AcDbPolyline"))
(setq #Len (+ #Len (vla-get-Length x)))
)
) ;_ cond
) ;_ vlax-for
(vla-delete #SS)
(alert (strcat "Total Length: "
(setvar 'users5 (rtos #Len))
"\nValue can be retrieved with \"(getvar 'UserS5)\""
) ;_ strcat
) ;_ alert
)
) ;_ cond
(princ)
) ;_ defun