CAD Forum - tips, tricks, discussion and utilities for AutoCAD, Inventor, Revit and other Autodesk products []
Cesky English Deutsch
 Visitors: 3611 

CAD tip CAD tip # 5448:

Question CAD 
 %  platform  category 
Q - question

How to select all entities in a specified layer?

A - answer To quickly select all objects from a given layer you can use the QSELECT or FILTER commands and choose the layer from a layer list. Or - in newer AutoCAD versions - use the command SELECTSIMILAR and pick a sample object.

But there is a quicker way - you can use a simple macro which selects all entities in the same layer as the layer of a picked entity (you can also pick nested objects and multiple objects/layers). The SELLAY.LSP macro can be found on or just type in:

(defun C:SELLAY ( / e lay)
 (setq e (nentsel "Select entity on a layer: "))
 (if e (ssget "_X" (list(cons 8 (cdr(assoc 8 (entget(car e))))))))
Load the LSP file with APPLOAD and then anywhere AutoCAD prompts to "Select objects" just type 'SELLAY (or 'SELLAYS for multiple layers).

If you enter SELLAY (or SELLAYS) as a primary command (on the Command: prompt), the objects will be selected as a grip selection set (for subsequent command). If you grip-select a group of objects before running SELLAY, only objects from this preselection set will be selected/filtered (not from the whole drawing).

100% *  CAD 
1.3.2007    86132×  
Comments   Tell a friend
applies to: AutoCAD ·

See also:
Tip 11868:Open just a part of a DWG drawing - layers, views.
Tip 11492:Adding selected numbers in drawing texts - counting numbers (GrSelNum).
Tip 10015:How to select and modify objects in all layouts of the DWG?
Tip 8857:Move all blocks containing a specific layer to that layer.
Tip 8415:Recolor entities to the color of their layer.

Back   All CAD Tips All CAD tips&tricks

How to demote an Inventor assembly to a part? « | » Visualize the view vector of a AutoCAD camera.

Have we helped you? If you want to support the CAD Forum web service, consider buying one of our CAD applications, or our custom software development offerings, or donating via PayPal (see above). You may also add a link to your web - like this "fan" link: CAD Forum - tips, utilities, blocks for Autodesk products
CAD:    OS:    Categ: 
Text:  FAQ glossary   

Extend your AutoCAD LT productivity with our popular add-on
CADstudio LT Extension More info

Please use these tips at your own risk.
CAD Studio (Xanadu) is not responsible for possible problems that may occur as a result of using any of these tips.