neeboy74 Posted June 28, 2016 Share Posted June 28, 2016 Hello to all: I have some LISPS that will move single-selected entities to different layers in a drawing These objects are all inside of blocks. I now need to have the functionality extended so I can select MULTIPLE OBJECTS outside of blocks and move them to specified layers. I have tried modifying the attached example file; the selection process works, but I am constantly getting "bad argument type: consp I've attached the LISP; what am I doing wrong? The objects in question that need to be moved are all lines, other geometry, etc. I have tried reading about selection criteria for this operation, but it's over my head. To_Layers.lsp Quote Link to comment Share on other sites More sharing options...
Tharwat Posted June 28, 2016 Share Posted June 28, 2016 (defun c:tolayer (/ doc ss sn) (setq doc (vla-get-activedocument (vlax-get-acad-object))) (vla-endundomark doc) (vla-startundomark doc) (cond ((not (tblsearch "LAYER" "HILMOT-ARROWS")) (princ (strcat "\nLayer < HILMOT-ARROWS > is not found !"))) ((and (princ "\nSelect object to move to layer < HILMOT-ARROWS >") (setq ss (ssget "_:L" '((0 . "~VIEWPORT")))) ) (while (setq sn (ssname ss 0)) (entmod (append (entget sn) '((8 . "HILMOT-ARROWS")))) (ssdel sn ss)) ) ) (vla-endundomark doc) (princ) ) (vl-load-com) Quote Link to comment Share on other sites More sharing options...
neeboy74 Posted June 28, 2016 Author Share Posted June 28, 2016 Thanks for the contribution, Tharwat, but I think your code is moving the whole block to the specified layer. I need to be able to move multiple-selected individual items INSIDE the block, not the whole block itself. Quote Link to comment Share on other sites More sharing options...
Tharwat Posted June 28, 2016 Share Posted June 28, 2016 I just modified your attached codes a bit. Is it okay with you to have a routine to move to layer just the picked object inside a block? is this what you are after? Quote Link to comment Share on other sites More sharing options...
neeboy74 Posted June 28, 2016 Author Share Posted June 28, 2016 I'm after the ones I select...and when I say select, I mean select with the normal "drag a window across" method. I'm trying to avoid picking each individual object, some of them are lines less than an inch long and that gets a little unnerving, trying to pick 20-30 reaaaaally small lines individually. I have to, on a very regular basis, modify 50-150 unique (of COURSE) block definitions. I'm trying to save time any way I can, and NOT having to open/close the block editor EVERY TIME is what I'm after. I've got the "move-all" option already covered. Quote Link to comment Share on other sites More sharing options...
pkenewell Posted June 28, 2016 Share Posted June 28, 2016 I'm after the ones I select...and when I say select, I mean select with the normal "drag a window across" method. I'm trying to avoid picking each individual object, some of them are lines less than an inch long and that gets a little unnerving, trying to pick 20-30 reaaaaally small lines individually. I have to, on a very regular basis, modify 50-150 unique (of COURSE) block definitions. I'm trying to save time any way I can, and NOT having to open/close the block editor EVERY TIME is what I'm after. I've got the "move-all" option already covered. Unfortunately - the SSGET function cannot do a multiple select within a block, unless you are in the refedit environment. The only way I know of is using (nentsel) which is a single selection only. If someone else here knows another way - great, but I don't think what your asking is possible with VL. As an alternative approach: are there common layers or linetypes (or any other common property) that can be searched for in these blocks? IF that is the case you could make a lisp to search for these within the block definition and make the changes. Quote Link to comment Share on other sites More sharing options...
neeboy74 Posted June 28, 2016 Author Share Posted June 28, 2016 Yeah that's what I was afraid of, no real solution....I am currently working on LISPS that will automate almost everything, but I was thinking about just in case "everything" isn't an ultimately-attainable solution. Thanks for your reply! 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.