balexx Posted August 28, 2019 Share Posted August 28, 2019 I would like to ask if it is possible to rename the layer names in dwg adding also line thickness (0.05, 0.18 etc.) and color number (10, 20, (240,212,230) 56 etc.. ) Example : Wall To Wall_0.05_250 Water To Water _0.18_200_220_160 Thank you. Quote Link to comment Share on other sites More sharing options...
Ish Posted August 28, 2019 Share Posted August 28, 2019 use command LAYTRANS (layer Translator) Quote Link to comment Share on other sites More sharing options...
Ish Posted August 28, 2019 Share Posted August 28, 2019 (edited) Add Prefix or suffix to all layers in a drawing By gman, August 17, 2006 in AutoLISP, Visual LISP & DCL Edited August 28, 2019 by Ish MODIFY Quote Link to comment Share on other sites More sharing options...
ronjonp Posted August 28, 2019 Share Posted August 28, 2019 Answer HERE. Quote Link to comment Share on other sites More sharing options...
harinezumi Posted August 29, 2019 Share Posted August 29, 2019 13 hours ago, ronjonp said: Answer HERE. very nice. but rgb color is translated to indexed color. Possible to have rgb or book color name? Thank you Quote Link to comment Share on other sites More sharing options...
maratovich Posted August 30, 2019 Share Posted August 30, 2019 22 hours ago, harinezumi said: but rgb color is translated to indexed color. Possible to have rgb or book color name? The solution is in the archive. RepLayer.zip Quote Link to comment Share on other sites More sharing options...
ronjonp Posted August 30, 2019 Share Posted August 30, 2019 On 8/29/2019 at 4:40 AM, harinezumi said: very nice. but rgb color is translated to indexed color. Possible to have rgb or book color name? Thank you Sure .. something like this: (defun c:foo (/ el) (vlax-for l (vla-get-layers (vla-get-activedocument (vlax-get-acad-object))) (setq el (entget (vlax-vla-object->ename l))) (vl-catch-all-apply 'vla-put-name (list l (strcat (vla-get-name l) "_" (if (minusp (vla-get-lineweight l)) "Default" (itoa (vla-get-lineweight l)) ) "_" (vl-princ-to-string (cond ((cdr (assoc 430 el))) ((assoc 420 el) (mapcar '(lambda (x) (vlax-get (vla-get-truecolor l) x)) '(red green blue)) ) ((cdr (assoc 62 el))) ) ) ) ) ) ) ) (vl-load-com) 1 Quote Link to comment Share on other sites More sharing options...
harinezumi Posted September 3, 2019 Share Posted September 3, 2019 On 8/30/2019 at 11:41 AM, maratovich said: The solution is in the archive thank you Quote Link to comment Share on other sites More sharing options...
harinezumi Posted September 3, 2019 Share Posted September 3, 2019 On 8/30/2019 at 4:26 PM, ronjonp said: Sure .. something like this: Thank you Quote Link to comment Share on other sites More sharing options...
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.