Categories

AutoCAD 2015 and AutoCAD LT 2015 Bible

The most comprehensive AutoCAD book around!

AutoCAD tutorial: Create a complex selection filter

For most purposes, the standard selection options are fine. For details, see Use All of Your Selection Options. If you need more, first see if Quick Select can help. See Select objects quickly with Quick Select.

Sometimes, you need a more precise tool to select objects. AutoCAD’s most full-featured tool for selection is the FILTER command. The filter command has 3 advantages:

  1. You can create very complex filtering parameters, using relational operators
  2. You can group multiple filters
  3. You can save filters

Create a single filter

To create a single filter, follow these steps:

  1. Type filter on the command line. If you’re in the middle of a command, type ‘filter to start the command transparently. The Object Selection Filters dialog box opens.
  2. Click the drop-down list in the Select Filter section of the dialog box to display the available objects, properties, object snaps (such as Line End and Line Start), and logical operators. You use the logical operators to combine filters.

  1. Choose the item that want from the drop-down list and click Add to List. You now see the item in the top pane. This filter you see here selects all polylines.

  1. Repeat to add other criteria, clicking Add to List each time. Some filters need a value, which you can supply in 2 ways:
  • You can choose from a list. For example, you can choose Layer. Then click the Select button to open the Select Layer(s) dialog box, where you can choose from the layers that exist in the drawing.

  • You can enter a value. For example, you can choose Circle Radius. Depending on which item you choose, one or more of the X, Y, and Z boxes become available. When you need only one value, use the X box. Then choose one of the relational operators from the drop-down list, as shown in the table. Here, I set the Circle Radius item to be less than or equal to 9.0000.

Here are your choices for operators that you can use when you need to specify a value.

Relational Operator Description
= Equal to
!= Not equal to
< Less than
<= Less than or equal to
> Greater than
>= Greater than or equal to
* Equal to any value

Note: As you add filters, AutoCAD assumes the AND operator, meaning that the selection needs to meet all of the criteria you specified. So, the following filter finds circles on the WALL layer whose radius is less than or equal to 9.0000.

Circle Radius <= 9.0000
Layer = WALL
Object = Circle

  1. Save your filter, in case you didn’t get it right or may need it again. Enter a name in the Save As text box and click the Save As button.
  2. To correct a filter item, click it in the top pane and click Delete, or Edit Item. You can also click Clear List to start over.
  3. When you’re done, click the Apply button.
  4. The dialog box closes and you see the Select objects: prompt. This allows you to specify the objects that you want to filter. You can type all and press Enter, or specify a window. AutoCAD selects the objects you specified in the filter.

If you didn’t start a command, you can start one now and use the Previous option to select the objects defined by the filter. Here you see the circles on the WALL layer with radius less than or equal to 9.0000 selected.

Create multiple filters

The previous example uses multiple filters with the default AND logical operator. However, you can combine filter criteria using the following logical operators:

Operator Description Example
AND Objects that meet all criteria Circles on the WALL layer
OR Objects that meet any of the criteria All circles and all objects on the WALL layer
XOR Objects that meet one or the other criteria, but not both Circles not on the WALL layer and non-circles on the WALL layer
NOT Objects that don’t meet the criteria If applied to the Object=Circle criterion, objects on the WALL layer that are not circles

For example, to find objects that are not circles on the WALL layer and circles not on the WALL layer, follow these steps:

  1. From the Select Filter drop-down list, choose BEGIN XOR and click Add to List.
  2. From the Select Filter drop-down list, choose Circle and click Add to List.
  3. From the Select Filter drop-down list, choose Layer. Click the Select button and choose the WALL layer. Click OK. Click Add to List.
  4. From the Select Filter drop-down list, choose END XOR and click Add to List.

The result is shown here.

Note: The XOR logical operator must enclose 2 criteria. The NOT logical operator must enclose only 1 criterion, the one that you don’t want to include in the selection.

  1. Continue to add criteria as described.
  2. Save the filter as previously described.
  3. Click Apply.
  4. The dialog box closes and you see the Select objects: prompt. This allows you to specify the objects that you want to filter. You can type all and press Enter, or specify a window.

AutoCAD selects the specified objects.

Ellen Finkelstein

2 comments to AutoCAD tutorial: Create a complex selection filter

  • Chad

    is there a search function that will allow me to select certain dynamic blocks, based off of their perameters/attributes/visibilty states?

  • Adnan

    i am going to calculate steel types with spaces using filter command selection ..so how can do that please : selecting all the texts (regardless of its layers or attributes) that containing some value such as 200 and its colour is green this is first condition the second condition (AND) all texts containing 2 parameter (1. its value is T20 , 2. its other value is L=400) ..please how can i do that in the FILTER command..very thanks.

    I have tried this code inside the filter command , but it did not work with me !

    **begin AND
    Object = Text
    Color = 3-Green
    Text Value = 200
    **End AND
    **Begin AND
    Object = Text
    Text Value = 7T20
    **End AND
    **Begin AND
    Object = Text
    Text Value = L=400
    **End AND

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>