Jump to content

move all 3.5mm text to layer text3.5


Recommended Posts

Posted

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.

Posted

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.

text selection by height filter.JPG

Posted

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)
)

Posted

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)
 )

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...