warrentdo Posted September 12, 2012 Posted September 12, 2012 Hello, We are using autocad 2012. Is there a way to move all 3.5mm text to layer text3.5 and move all 5mm text to layer text5. I was hoping in a lisp rather than Qselect. Any pointer would be great. Regards Warren. Quote
Dadgad Posted September 12, 2012 Posted September 12, 2012 Welcome to the forum. Sounds like a very simple lisp, somebody will set you up. I would just create a saved FILTER and do it with my QUICK PROPERTIES palette, which would be pretty quick, if you had already set up and saved the filters for frequent use. Obviously not as quick as a lisp. Quote
Lee Mac Posted September 12, 2012 Posted September 12, 2012 Try something like this: (defun c:txt2lay ( / d e i s ) (setq d (getvar 'dimzin)) (setvar 'dimzin (if (setq s (ssget "_X" '((0 . "TEXT") (-4 . "<OR") (40 . 3.5) (40 . 5.0) (-4 . "OR>")))) (repeat (setq i (sslength s)) (setq e (entget (ssname s (setq i (1- i))))) (entmod (subst (cons 8 (strcat "text" (rtos (cdr (assoc 40 e)) 2))) (assoc 8 e) e)) ) ) (setvar 'dimzin d) (princ) ) Quote
Tharwat Posted September 12, 2012 Posted September 12, 2012 If the Op meant the string and not the height . (defun c:Test (/ ss i e) (if (and (tblsearch "LAYER" "text3.5") (tblsearch "LAYER" "text5") ) (if (setq ss (ssget "_X" '((0 . "*TEXT") (-4 . "<OR") (1 . "3.5mm") (1 . "5mm") (-4 . "OR>")))) (repeat (setq i (sslength ss)) (setq e (entget (ssname ss (setq i (1- i))))) (if (eq (cdr (assoc 1 e)) "3.5mm") (entmod (subst (cons 8 "text3.5") (assoc 8 e) e)) (entmod (subst (cons 8 "text5") (assoc 8 e) e)) ) ) ) (princ "\n one or the two layers are not found in the drawing ") ) (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.