pnoraa Posted September 19, 2013 Posted September 19, 2013 I'm trying to find a lisp to change layer linetypes and colours if they contain certain text in their layer name. e.g if I have a layer called "contour 1234" among others, can a lisp change the colour and linetype of layers starting with contour ? and does anyone know where I can find a lisp for this? Quote
Tharwat Posted September 19, 2013 Posted September 19, 2013 Welcome to the forum first Can you write down what is the color and the line type to be changed if the code find a layer name starts with contour ##### ? Tharwat Quote
Tharwat Posted September 19, 2013 Posted September 19, 2013 Change the line type and the color in the code to meet your needs . (defun c:Test (/ lt cl l e) ;; Tharwat 19.Sep.2013 ;; (setq lt "DASHED" ;; LineType ;; cl 3 ;; Color number ;; ) (if (not (tblsearch "LTYPE" lt)) (vla-load (vla-get-Linetypes (vla-get-ActiveDocument (vlax-get-acad-object) ) ) lt "acadiso.lin" ) ) (while (setq l (tblnext "LAYER" (null l))) (if (wcmatch (cdr (assoc 2 l)) "contour*") (progn (setq e (entget (tblobjname "LAYER" (cdr (assoc 2 l)))) e (subst (cons 62 cl) (assoc 62 e) e) e (subst (cons 06 (if (and lt (tblobjname "ltype" lt)) lt "Continuous" ) ) (assoc 06 e) e ) ) (entmod e) ) ) ) (princ) ) (vl-load-com) 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.