Is there a quick and easy way to turn on layers that have a specific text style?
Do you mean layers that have existing text entities, using a specific text style, on them? Kent Cooper, AIA style?
Yes, if you know how to program!!!! This is not the most elegant and does not use VLA functions, but it does work - (setq StyleName "STANDARD") (if (setq SS (ssget "X" (list (cons 0 "TEXT")))) (progn (setq LayerList nil) (setq KK 0 KS (sslength SS)) (while (< KK KS) (setq LN (cdr (assoc 8 (setq EG (entget (ssname SS KK)))))) (if (and (= (strcase (cdr (assoc 7 EG))) StyleName) (not (member LN LayerList))) (setq LayerList (append LayerList (list LN))) ) (setq KK (1+ KK)) ) (if LayerList (progn (command "LAYER") (foreach LN LayerList (command "ON" LN)) (command "") ) ) ) )
I see Alan beat me to the punch. But here is another way, with prompt for style. ;; ;; Define DXF function ;; (defun dxf (code elist) (cdr (assoc code elist)) ); end function dxf ;; ;; ;; Define function tdlist ;; (defun tdlist (tbname / tdata tblist) (while (setq tdata (tblnext tbname (not tdata))) (setq tblist (append tblist (list tdata))) ); end while ); end function tdlist ;; ;; make layers list ;; (foreach tbdata (tdlist "layer") (setq lname (substr (dxf 2 tbdata) 1 50)) ;; (if (/= lname nil) (progn (setq P (strcat "\nFound " lname " Layer")) (prompt P) ); end progn ); end if ); end foreach ;; (defun C:TL () (setq st (getstring "\nStyle name:")) (foreach lay (tdlist "layer") (setq lname (substr (dxf 2 lay) 1 50)) (setq ss nil) (setq ss (ssget "x" (list (cons 8 lname)(cons 7 st)(cons 0 "TEXT")))) (if ss (command "_layer" "_T" lname "_on" lname "") ); if (prompt (strcat "\nChecking Layer " lname)) (princ) ); foreach ); defun (princ) Bob Shaw www.bobscadshop.com