CAD Forum - tips, tricks, discussion and utilities for AutoCAD, Inventor, Revit and other Autodesk products [www.cadforum.cz] ARKANCE | CONTACT - CZ | SK | EN | DE
Over 1.096.000 registered users (EN+CZ). AutoCAD tips, Inventor tips, Revit tips. Try the new precise Engineering calculator and the updated Barcode generator. New AutoCAD 2026 commands and variables.

CAD tip CAD tip # 5448:

Question

CAD 
 %  platform  category 
A
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 DL 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).

ACAD
100% *CAD
1.3.2007    101994×  
applies to: AutoCAD ·

See also:
Tip 14604:QRcode - dynamically generated QR codes in AutoCAD.
Tip 14526:How to export geometry from AutoCAD DWGs to JSON files and import it back?
Tip 14268:How to set the background mask color to BYLAYER?
Tip 14242:How to find the minimum, maximum or local extreme of a 2D or 3D curve?
Tip 14163:How to select DWG texts containing a certain number of characters?


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
  



Featuring:
Link your AutoCAD block attributes with Excel tables/sheets. Automatically. Dynamically. Bidirectionally.
Try Excellink 2015 More info


Please use these tips at your own risk.
ARKANCE is not responsible for possible problems that may occur as a result of using any of these tips.
TOPlist