CAD Forum - tips, tricks, discussion and utilities for AutoCAD, Inventor, Revit and other Autodesk products []
CZ | EN | DE
Login or
  Visitors: 7010

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 Download 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    99947×  
Prices - CAD eShop:
applies to: AutoCAD ·

See also:
Tip 13938:ModDXF - utility for bulk modification/display of internal DXF properties in DWG entities.
Tip 13858:Is there also a SETBYBLOCK command?
Tip 13038:How to explode 3D faces (3DFACE) into outline polyline?
Tip 12215:How to change truecolor DWG objects to indexed ACI colors?
Tip 12036:Sel2BlkRef (blockify) - replace repeating objects with block references

Back   All CAD Tips

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.
Arkance Systems is not responsible for possible problems that may occur as a result of using any of these tips.