5 Simple AutoLISP Selection Sets

kick it on CadKicks.com

Not being a programmer I am not going to get into the technical details of constructing  code, but I am going to share with you 5 simple codes to help you make selection-sets. I use these all the time and I even plug them into and  (more on that later). Here they are:

Select objects on a layer:

(ssget "x" (list (cons 8 "LayerName")))

Replace LayerName with the layer on which objects you want to select.

Select blocks:

(ssget "x" (list (cons 2 "BlockName")))

Replace BlockName with the name of the blocks you want to select.

Select an object type:

(ssget "X" (list(cons 0 "EntityName")))

EntityName could be LINE, LWPOLYLINE, CIRCLE, etc… Experiment with it. For example to select all lightweight polylines, you would type (ssget “X” (list(cons 0 “LWPOLYLINE”)))

Select text with a specific text style:

(ssget "X" (list(cons 7 "TextStyle")))

Replace TextStyle with the name of a text style to select text objects on that text style.

Select objects with a specific linetype:

(ssget "X" (list(cons 6 "LinetypeName")))

Replace LinetypeName with the name of a linetype to select objects with that linetype.

Once you enter a selection set on the command line, simply invoke a command (such as move, if you want to move the objects) and when it asks for a selection, type P for previous. It’s that simple!

Just another way to work lazier smarter!

Share and Enjoy:
  • Digg
  • Technorati
  • LinkedIn
  • Facebook
  • del.icio.us
  • TwitThis
  • StumbleUpon
  • Live
  • Google

2 Comments so far

  1. Sign up at Gravatar.com to add your picture. Lazy Drafter » Writing Scripts on August 27th, 2008

    [...] you know that you can plug in AutoLISP code into your scripts? Let’s say you want to create a selection set of objects on a certain layer and change them to another layer. You could write a script like [...]

  2. Sign up at Gravatar.com to add your picture. CadKicks.com on November 14th, 2008

    5 Simple AutoLISP Selection Sets…

    You’ve been kicked (a good thing) - Trackback from CadKicks.com…

Leave a reply