SLW210 Posted June 10, 2013 Posted June 10, 2013 Please read the Code posting guidelines and edit your post to include the Code in Code Tags. Quote
pBe Posted June 12, 2013 Posted June 12, 2013 Didn't you get a lisp routine in post #8? Well, i wasn't aware the OP is not targeting a specific layer from a list. hence the reply "its not working [crisraj99]" FWIW (defun c:WLTT (/ data fl opt run ef) ; write layer count to text (setq data nil) (vlax-for layout (vla-get-layouts (vla-get-ActiveDocument (vlax-get-acad-object))) (vlax-for i (vla-get-block layout) (Setq fl (vla-get-layer i)) (setq data (if (setq ex (assoc fl data)) (subst (list fl (1+ (cadr ex))) ex data) (cons (list fl 1) data))))) (initget "Yes No") (setq opt (cond ((Getkword "\nWrite to file [Yes/No]: "))("Yes"))) (setq run (if (and (setq opt (Eq opt "Yes")) (setq ef (getfiled "Save data file" (getvar 'Dwgprefix) "txt" 1 )) (setq f (open ef "w"))) (lambda (o) (write-line (Strcat (car o) "-----> " (itoa (Cadr o))) f)) (lambda (o) (print (Strcat (car o) "-----> " (itoa (Cadr o)))))) ) (foreach itm data (if (not (zerop (Cadr itm))) (run itm)) ) (if opt (progn (close f) (startapp "notepad" ef)) (textscr)) (princ) ) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.