CAD Forum - tips, tricks, discussion and utilities for AutoCAD, Inventor, Revit and other Autodesk products [www.cadforum.cz] ARKANCE | CONTACT - CZ | SK | EN | DE

CAD tip CAD tip # 13688:

Question

CAD 
 %  platform  category 
A
Starting in version 2024, AutoLISP can be used in AutoCAD LT, so you can create selection sets using filters with DXF codes, just like in full AutoCAD. These can be used both for grip selection and for selection at the "Select objects:" prompt in the middle of an AutoCAD editing command.

So for example:

  • Select all line geometry (lines, polylines, splines) in the current layout:
    (sssetfirst nil (setq ss (ssget "_X" (list '(0 . "*LINE")(cons 410 (getvar "CTAB"))))))ss
  • Select all green objects in the current layout:
    (sssetfirst nil (setq ss (ssget "_X" (list '(62 . 3)(cons 410 (getvar "CTAB"))))))ss
  • Select all texts starting with an uppercase "A":
    (sssetfirst nil (setq ss (ssget "_X" (list '(0 . "*TEXT")'(1 . "A*")(cons 410 (getvar "CTAB"))))))ss
  • Select all red circles and arcs in the Situation layer:
    (sssetfirst nil (setq ss (ssget "_X" (list '(0 . "CIRCLE,ARC")'(8 . "Situation")'(62 . 1)(cons 410 (getvar "CTAB"))))))ss

The ssget filters can also use AND, OR and NOT conditions, parentheses, greater/lesser, wildcard characters, X/Y/Z coordinate components, etc. See examples in other tips.

ACADACLT
100% *CAD
5.4.2023    24727×  
applies to: AutoCAD · AutoCAD LT ·

See also:
Tip 14620:Converting object data (OD) to XData (XD) in AutoCAD Map 3D.
Tip 12210:How to erase a specific object type in all DWG layouts?
Tip 11179:Select objects in negative elevation or in a given 3D octant.
Tip 10015:How to select and modify objects in ALL layouts of the DWG?
Tip 7249:How to select all drawing entities containing a given text?


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:
Revit plugins for automating data management, opening creation for clashes, and documentation Be.Smart Core Collection 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