121madhu Posted July 13, 2013 Posted July 13, 2013 Any idea have to change one layer to another layer any one color objects Quote
Tharwat Posted July 13, 2013 Posted July 13, 2013 What is the name of the source layer you want to select its objects on different colors and whats the name of the target layer name ? Quote
121madhu Posted July 13, 2013 Author Posted July 13, 2013 Dimensions, invert levels both are deferent color but one layer in my dwg. I trying to change deferent layers (layer-DIM and layer-IL ) both are deferent color so can I change selective color to modify Quote
Tharwat Posted July 13, 2013 Posted July 13, 2013 (edited) I can't get what you want to do with your poor explanation Edited July 13, 2013 by Tharwat Quote
121madhu Posted July 14, 2013 Author Posted July 14, 2013 Three colors having this dwg. But single layer so I want change three layers as same color objects I done this job select objects manually its taking so much time. Any another way is there change layer selective color objects current layer to user defined layer Thanks for your support Quote
Tharwat Posted July 14, 2013 Posted July 14, 2013 What are the colors of objects that you want to change or move to another Layer ? What's the name of the Layer which the objects should be moved to ? Quote
121madhu Posted July 14, 2013 Author Posted July 14, 2013 Check attached pic. Three colors (yellow, green, pink) unfortunately single layer Yellow- invert levels Green – coordinates Pink- dimensions How Can I Change by color current layer to user defined (example:- Yellow- invert levels destination layer INVERT LEVELS Green – coordinates destination layer COCRDINATES Pink- dimensions destination layer DIMENSIONS). Quote
Tharwat Posted July 14, 2013 Posted July 14, 2013 This ? (defun c:Test (/ lst l ss i e) (foreach x (setq lst '((2 . "INVERT LEVELS") (3 . "COORDINATES") (6 . "DIMENSIONS") ) ) (if (not (tblsearch "LAYER" (cdr x))) (setq l (cons (cdr x) l)) ) ) (if l (alert (strcat "Layers not found in the drawing < " (apply 'strcat (mapcar '(lambda (x) (strcat " <" x "> ")) l) ) " >" ) ) (if (setq ss (ssget "_:L" '((-4 . "<OR") (62 . 2) (62 . 3) (62 . 6) (-4 . "OR>")) ) ) (repeat (setq i (sslength ss)) (setq e (entget (ssname ss (setq i (1- i))))) (foreach u lst (if (eq (car u) (cdr (assoc 62 e))) (progn (setq e (subst (cons 62 256) (assoc 62 e) e) e (subst (cons 8 (cdr u)) (assoc 8 e) e) ) (entmod e) ) ) ) ) ) ) (princ) ) Quote
121madhu Posted July 15, 2013 Author Posted July 15, 2013 Tharwat i want learn lisp please help me Quote
Tharwat Posted July 15, 2013 Posted July 15, 2013 Tharwat i want learn lisp please help me Did the code work for you as you have asked for ? Quote
CheSyn Posted July 16, 2013 Posted July 16, 2013 Tharwat, What about creating a selection set filtering colour, and wrapping entmod in a while statement (it's how I would go about this)? Or is using a list, repeat, and foreach generally considered preferred/proper formatting? I am newer to LISP and wondering if there are "proper" and "frowned-upon" methods of addressing problems. Quote
Tharwat Posted July 16, 2013 Posted July 16, 2013 Tharwat, What about creating a selection set filtering colour, and wrapping entmod in a while statement (it's how I would go about this)? Or is using a list, repeat, and foreach generally considered preferred/proper formatting? I am newer to LISP and wondering if there are "proper" and "frowned-upon" methods of addressing problems. All the fore said functions would bring the same result since all of them iterate through selection set , and there is nothing wrong to use while function instead of repeat or foreach or even vlax-for if you have the intention to go with Visual Lisp functions . Quote
Tharwat Posted July 16, 2013 Posted July 16, 2013 Thank you, Tharwat. Much appreciated. You're welcome anytime . 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.