change particular layer lineweight to another linewight

change particular layer lineweight to another linewight

sivarajann
Contributor Contributor
1,117 Views
2 Replies
Message 1 of 3

change particular layer lineweight to another linewight

sivarajann
Contributor
Contributor

change particular layer lineweight to another linewight.

eg. I have so many layers its lineweights are 0.00, 0.15, 0.30, 0.40, 0.50, etc. I need to change LW 0.00 and 0.15 layers(many layers) to 0.30 lineweight other lineweights to keep as it is.

please provide a simple script / Lisp. that help me to change bulk of drawings.

thank you

0 Likes
Accepted solutions (2)
1,118 Views
2 Replies
Replies (2)
Message 2 of 3

_gile
Consultant
Consultant
Accepted solution

Hi,

 

You can paste the following code to the command line and hit Enter, or use it in a script file.

 

((lambda (/ n l w)
   (while (setq n (cdr (assoc 2 (tblnext "LAYER" (not n)))))
     (setq w (cdr (assoc 370 (setq l (entget (tblobjname "LAYER" n))))))
     (if (or (= w 0) (= w 15))
       (entmod (subst '(370 . 30) (cons 370 w) l))))))


Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

Message 3 of 3

sivarajann
Contributor
Contributor
Accepted solution

hi Gile,

its working

thank you


@_gile wrote:

Hi,

 

You can paste the following code to the command line and hit Enter, or use it in a script file.

 

((lambda (/ n l w)
   (while (setq n (cdr (assoc 2 (tblnext "LAYER" (not n)))))
     (setq w (cdr (assoc 370 (setq l (entget (tblobjname "LAYER" n))))))
     (if (or (= w 0) (= w 15))
       (entmod (subst '(370 . 30) (cons 370 w) l))))))


 


 

0 Likes