Mystogan Posted August 9, 2023 Posted August 9, 2023 Hi Hoping someone could help me to create a lsp that make all the selected block change into layer 0 and also the properties into By layer. I try this one https://www.cadtutor.net/forum/topic/73427-lisp-to-change-layer-to-nest-objects-inside-block-putting-them-on-block-layer/ But it didn't work I got an automation error. The drawing is in color dependent plot style mode. There two types of block one is dynamic and regular, I hope it will be applicable for both type. Quote
ronjonp Posted August 9, 2023 Posted August 9, 2023 (edited) 23 hours ago, Mystogan said: Hi Hoping someone could help me to create a lsp that make all the selected block change into layer 0 and also the properties into By layer. I try this one https://www.cadtutor.net/forum/topic/73427-lisp-to-change-layer-to-nest-objects-inside-block-putting-them-on-block-layer/ But it didn't work I got an automation error. The drawing is in color dependent plot style mode. There two types of block one is dynamic and regular, I hope it will be applicable for both type. Try the code here: http://www.theswamp.org/index.php?topic=3020.msg37746#msg37746 Edited August 10, 2023 by ronjonp Quote
Mystogan Posted August 10, 2023 Author Posted August 10, 2023 Hi ronjonp thank you, I found the right for me. It was done by: David Bethel Here's the code (defun c:upb (/ tdef fe ed) (while (setq tdef (tblnext "BLOCK" (not tdef))) (princ (strcat "\n" (strcase (cdr (assoc 2 tdef))))) (setq fe (cdr (assoc -2 tdef))) (while fe (setq ed (entget fe) ed (subst '(8 . "0") (assoc 8 ed) ed) ed (if (assoc 62 ed) (subst '(62 . 256) (assoc 62 ed) ed) (append ed '((62 . 256))))) (entmod ed) (setq fe (entnext fe)))) (prin1)) 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.