Select by layer?

Select by layer?

mbloswick
Enthusiast Enthusiast
17,188 Views
10 Replies
Message 1 of 11

Select by layer?

mbloswick
Enthusiast
Enthusiast

I'm looking for a tool or LISP that works like a cross between SELECTSIMILAR and QSELECT.

really would like to select elements by layer.
Qselect is bulky, and requires me to scroll through my list of layers to find the one I want. There is no way to "match" an element to use as a filter with Qselect.

SelectSimilar is a one-click filter, but it will only select the same element TYPE, so if I select a polyline, but other elements of interest are lines and arcs, those won't be selected.

 

I want to be able to click on an element, and then select all other elements on that level regardless of type.

 

Is there a Qselect setting that will allow for an existing element to be chosen to set the properties? Is there a SelectSimilar setting that will disregard element type? Is there a LISP out there that will do this one thing?

Thank you.

0 Likes
Accepted solutions (1)
17,189 Views
10 Replies
Replies (10)
Message 2 of 11

dmfrazier
Advisor
Advisor

Have you tried FILTER?

0 Likes
Message 3 of 11

user181
Mentor
Mentor
Accepted solution

Maybe the GETSEL command will work for you?  First select object on the layer you want then select object type or * for all. 

EESignature


Message 4 of 11

mbloswick
Enthusiast
Enthusiast

Interesting, but not exactly a quick solution for a one-off. I can see setting that sort of thing up in a template file for repetitive tasks/choices. Is there a way to copy Filters from one drawing to another?

0 Likes
Message 5 of 11

mbloswick
Enthusiast
Enthusiast

GETSEL is what I'm looking for - thank you!
It took me a minute to figure it out, because it drops the selection set after selecting the elements. I had to look it up to find out that I then need to Select -> Previous. But so much easier than Qselect!

Thanks again!

0 Likes
Message 6 of 11

dmfrazier
Advisor
Advisor

"Interesting, but not exactly a quick solution for a one-off."

 

I agree.

 

I can see setting that sort of thing up in a template file for repetitive tasks/choices. Is there a way to copy Filters from one drawing to another?

 

Saved filters are not stored in DWGs. They are stored in a file (filter.nfl), in your AppData...Roaming...Support folder.

0 Likes
Message 7 of 11

mbloswick
Enthusiast
Enthusiast

Nice!

So I could set up some filters, and use them across projects. I'll have to look deeper into this one. GETSEL gives me what I need now, but FILTERS has promise.

0 Likes
Message 8 of 11

ВeekeeCZ
Consultant
Consultant

You can try this lisp of mine. I usually just pre-select some object/s... but it offers some more options...

0 Likes
Message 9 of 11

mbloswick
Enthusiast
Enthusiast

Thank you!

I'll give that a whirl.

0 Likes
Message 10 of 11

Kent1Cooper
Consultant
Consultant

@mbloswick wrote:

....

I want to be able to click on an element, and then select all other elements on that level [layer --KC] regardless of type.

....


How about something like this?

(defun C:SAL (/ ent ss); = Select All on Layer [of selected object]
  (defun getobj ()
    (while (not ent)
      (setq ent (car (entsel "\nSelect one object to get all objects on its Layer: ")))
    ); while
  ); defun
  (cond ; OBJECT SELECTION
    ( (and
        (setq ss (ssget "_I")); something pre-selected
        (= (sslength ss) 1); only one object
      ); and
      (setq ent (ssname ss 0))
    ); first condition [single pre-selected object]
    ( (ssget "_I"); more than one object selected
      (sssetfirst nil); un-select multiple objects
      (getobj); User select
    ); second condition
    ((getobj)); User select [nothing pre-selected]
  ); cond
  (sssetfirst nil (setq SALSS (ssget "_X" (list (assoc 8 (entget ent))))))
  (prin1)
); defun

If you have a single object selected when you call the command, it uses that.  If you have either more than one or no pre-selection, it asks you to select one object.

It leaves all objects on the Layer selected/highlighted/gripped, so you can call a command directly to apply to them, and it puts them into a non-localized variable called SALSS that you can use as you like afterwards.

Kent Cooper, AIA
0 Likes
Message 11 of 11

AVCPlugins
Advisor
Advisor

You can use the AVC Properties Palette plugin. If you click on the layer property of any object, then a button with a magnifying glass appears next to the field - this is a search for all objects with the same property value (in this case, the same layer). In this case, all objects of the layer will be selected regardless of their type.


Plugins for AutoCAD
A>V>C>
AppStore | Facebook | Twitter | YouTube | Blog
0 Likes