Display full version of the post: Can anyone please help with this lisp routine?

increase
06.10.2007, 07:51
Hello,I have this lisp routine to output data to excel(defun C:PEXPXL ( / ss lst fname fil sel2lst) (defun sel2lst ( sel / l len ) (if (= 'PICKSET (type sel)) (repeat (setq len (sslength sel)) (setq len (1- len) l (cons (ssname sel len) l) ) ;setq ) ;repeat ) ;if) (setvar "CMDECHO" 0) (princ "\nSelect Circle,Polyline,Ellipse,Spline or Region") (if (and (setq ss (ssget '((0 . "CIRCLE,*POLYLINE,ELLIPSE,REGION,SPLINE")))) (setq lst (sel2lst ss)) (setq fname (getfiled "Select Excell file" "" "xls" 1)) ) (progn (setq fil (open fname "w")) (write-line "Object\tPerimeter" fil) (foreach en lst (command "_AREA" "_Object" en) (write-line (strcat (cdr(assoc 0 (entget en)))"\t" (rtos (getvar "PERIMETER") 2 12)) fil) ) (close fil) (princ "\nPerimeter of ")(princ (length lst)) (princ " object export to ")(princ fname) ) ) (princ) )(princ "\nType PEXPXL to run")I would like the routine to automatically select 'all' lines, arcs etc and save as a text fileautomatically without having to select through the menu, press enter and save the fileI also want to include in the output a count of objects, for instance in the attached sample the number of objects would be 14Can anyone help please, I am running this on Intellicad 6.4 SEsample drawing herehttp://www.divshare.com/download/2222051-d92