Jump to content

Recommended Posts

Posted

Hey all,

I am using AutoCAD 2010 and was just wondering if there is anyway maybe via the layer manager to select all objects on multiple layers quickly. Qselect is a bit laborious as I am trying to select all the objects on about 8 or 9 layers, and have to run through the command for each layer and just add it to selection set. FILTER also gets the job done, but once again it feels like there should be an easier way. I have seen GETSEL suggested as well, but i am not too sure how to use it. Any tips or insight would be much appreciated. Cheers

Posted

SSX will allow you to select everything on multiple layers. Just use wildcards and/or commas.

 

Command: ssx

Select object <None>:

Enter filter option [block 
name/Color/Entity/Flag/LAyer/LType/Pick/Style/Thickness/Vector]: la

>>Enter layer name to add <RETURN to remove>: *STRM*,*SSWR*

Current filter: ((8 . "*STRM*,*SSWR*"))
Enter filter option [block 
name/Color/Entity/Flag/LAyer/LType/Pick/Style/Thickness/Vector]:

Posted

Is there any way with that command to select layers instead of typing them all in? The layer names are a bit long and it seems it may be harder to do it that way.

 

Out of curiousity, what are the two commands at the end of this line?

 

>>Enter layer name to add : *STRM*,*SSWR*

Posted
Is there any way with that command to select layers instead of typing them all in? The layer names are a bit long and it seems it may be harder to do it that way.

 

Out of curiousity, what are the two commands at the end of this line?

 

>>Enter layer name to add : *STRM*,*SSWR*

That was just an example of me wanting to select all layers that have either STRM or SSWR in them. The * indicates it will accept anything on the left/right side of what I've typed.

 

For instance, *STRM* will yield C-STRM, C-STRM-TEXT, C-STRM-PIPE, C-STRM-STRC.

Posted

ahhh I see, that may be perfect actually. Thank you very much for your quick responses. I will give it a go and let you know how it goes.

Posted

Maybe something like this:

 

LayerObjectSelect.jpg

 

I really like this idea. It's late and I just ripped the code out quick. I'll post something in the morning.

Posted

Yeah, that looks like the perfect solution. I think that is the option I will pursue, any info you can provide would be much appreciated.

 

I'm having some difficulties with the SSX command. It doesn't seem to actually select the objects on the specified layer, is there an additional command to select the items that have been filtered?

 

Thanks again for your help.

Posted

Give this a shot:

;;; LayerObjectSelect
;;; Select all objects on selected layers, in current layout
;;; Required Subroutines: AT:ListSelect, AT:TabFilter
;;; Alan J. Thompson, 11.05.09
(defun c:LOS (/ _Layers #List #Filter #SS)
 (vl-load-com)
 (setq _Layers (lambda (/ d n l)
                 (while (setq d (tblnext "layer" (null d)))
                   (and (not (wcmatch (setq n (cdr (assoc 2 d))) "*|*"))
                        (setq l (cons n l))
                   ) ;_ and
                 ) ;_ while
                 (vl-sort l '<)
               ) ;_ lambda
 ) ;_ setq
 (cond
   ((if dos_multilist
      (setq #List (dos_multilist "Select all objects on Layers" "Select layers:" (_Layers)))
      (setq #List (AT:ListSelect
                    "Select all objects on Layers"
                    "Select layers:"
                    "30"
                    "15"
                    "true"
                    (_Layers)
                  ) ;_ AT:ListSelect
      ) ;_ setq
    ) ;_ if
    (setq #Filter "")
    (foreach x #List (setq #Filter (strcat #Filter x ",")))
    (and (setq #SS (ssget "_X" (list (AT:TabFilter) (cons 8 #Filter))))
         (sssetfirst nil #SS)
         (print #List)
    ) ;_ and
   )
 ) ;_ cond
 (princ)
) ;_ defun

You will need my AT:ListSelect & AT:TabFilter subroutines. You can find them here: http://www.cadtutor.net/forum/showthread.php?t=40344

 

I also added a check to use the dos_lib list box instead of mine because it's nicer. If dos_lib is loaded, it will use it, if not, it will use mine. :)

Posted

For this I use lockall layers (LKA) and layerunlock (LU) utility, lock all layers, unlock the three, all with picks on objects, select all. Very simple lisp file with lots of uses.

Posted
For this I use lockall layers (LKA) and layerunlock (LU) utility, lock all layers, unlock the three, all with picks on objects, select all. Very simple lisp file with lots of uses.

 

I use something similar to that. I wrote one that will lock all except the layers of a group of selected objects. That way I can see the other objects, but am unable to alter them. Saves me a lot of headaches (LEE) Lock EverythingElse.

Posted

Hey Alanjt,

 

Thank you for your help, that LOS script has worked a treat. It does exactly what I wanted to do. Much appreciated. One last question, how would I get these to load automatically when AutoCAD starts? With out having to type (load "layerobjectselect") etc etc each time?

Posted

ahh never mind, I figured it out, I used the APPLOAD command and edited the startup suite. Once again thanks for all your help, I am sure I will have more questions as time goes on.

Posted
Hey Alanjt,

 

Thank you for your help, that LOS script has worked a treat. It does exactly what I wanted to do. Much appreciated. One last question, how would I get these to load automatically when AutoCAD starts? With out having to type (load "layerobjectselect") etc etc each time?

No problem, I liked the idea of being able to select multiple layers. It went right into my MiscUsefulRoutines.lsp file.

 

You can use appload or just put the (load "layerobjectselect" nil) in your acaddoc.lsp file.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...