    

 ## On this page

  

 

 # `NamedSelectionCriteria`

 Last update: 16.07.2025 

<a id="ansys.mechanical.stubs.v242.Ansys.ACT.Automation.Mechanical.NamedSelectionCriteria"></a>

#### *class* Ansys.ACT.Automation.Mechanical.NamedSelectionCriteria

Bases: [`object`](https://docs.python.org/3/library/functions.html#object)

A collection of named selection criteria.

<a id="overview"></a>

## Overview

### Methods

NameDescription[`Add`](#NamedSelectionCriteria.Add)Adds the given criterion to the collection.[`Clear`](#NamedSelectionCriteria.Clear)Clears the collection.[`Contains`](#NamedSelectionCriteria.Contains)Returns whether the collection contains the given criterion.[`IndexOf`](#NamedSelectionCriteria.IndexOf)Returns the index of the given criterion if it exists in the collection. Returns -1 if it does not[`Insert`](#NamedSelectionCriteria.Insert)Inserts the given criterion into the collection at the given index.[`Remove`](#NamedSelectionCriteria.Remove)Removes the given criterion from the collection if it exists in the collection. Throws an exception if it does not.[`RemoveAt`](#NamedSelectionCriteria.RemoveAt)Removes the criterion at the given index. Throws an exception if the given index is not valid.### Properties

NameDescription[`Count`](#NamedSelectionCriteria.Count)The number of criteria in the collection.[`Item`](#NamedSelectionCriteria.Item)Item property.<a id="property-detail"></a>

## Property detail

<a id="NamedSelectionCriteria.Count"></a>

### *property* NamedSelectionCriteria.Count *: [int](https://docs.python.org/3/library/functions.html#int) | [None](https://docs.python.org/3/library/constants.html#None)*

The number of criteria in the collection.

<a id="NamedSelectionCriteria.Item"></a>

### *property* NamedSelectionCriteria.Item *: [Ansys.ACT.Automation.Mechanical.NamedSelectionCriterion](NamedSelectionCriterion.md#ansys.mechanical.stubs.v242.Ansys.ACT.Automation.Mechanical.NamedSelectionCriterion) | [None](https://docs.python.org/3/library/constants.html#None)*

Item property.

<a id="method-detail"></a>

## Method detail

<a id="NamedSelectionCriteria.Add"></a>

### NamedSelectionCriteria.Add(criterion: [Ansys.ACT.Automation.Mechanical.NamedSelectionCriterion](NamedSelectionCriterion.md#ansys.mechanical.stubs.v242.Ansys.ACT.Automation.Mechanical.NamedSelectionCriterion))

Adds the given criterion to the collection.

<a id="NamedSelectionCriteria.Clear"></a>

### NamedSelectionCriteria.Clear()

Clears the collection.

<a id="NamedSelectionCriteria.Contains"></a>

### NamedSelectionCriteria.Contains(criterion: [Ansys.ACT.Automation.Mechanical.NamedSelectionCriterion](NamedSelectionCriterion.md#ansys.mechanical.stubs.v242.Ansys.ACT.Automation.Mechanical.NamedSelectionCriterion))

Returns whether the collection contains the given criterion.

<a id="NamedSelectionCriteria.IndexOf"></a>

### NamedSelectionCriteria.IndexOf(criterion: [Ansys.ACT.Automation.Mechanical.NamedSelectionCriterion](NamedSelectionCriterion.md#ansys.mechanical.stubs.v242.Ansys.ACT.Automation.Mechanical.NamedSelectionCriterion))

Returns the index of the given criterion if it exists in the collection. Returns -1 if it does not

<a id="NamedSelectionCriteria.Insert"></a>

### NamedSelectionCriteria.Insert(index: [int](https://docs.python.org/3/library/functions.html#int), criterion: [Ansys.ACT.Automation.Mechanical.NamedSelectionCriterion](NamedSelectionCriterion.md#ansys.mechanical.stubs.v242.Ansys.ACT.Automation.Mechanical.NamedSelectionCriterion))

Inserts the given criterion into the collection at the given index.

<a id="NamedSelectionCriteria.Remove"></a>

### NamedSelectionCriteria.Remove(criterion: [Ansys.ACT.Automation.Mechanical.NamedSelectionCriterion](NamedSelectionCriterion.md#ansys.mechanical.stubs.v242.Ansys.ACT.Automation.Mechanical.NamedSelectionCriterion))

Removes the given criterion from the collection if it exists in the collection. Throws an exception if it does not.

<a id="NamedSelectionCriteria.RemoveAt"></a>

### NamedSelectionCriteria.RemoveAt(index: [int](https://docs.python.org/3/library/functions.html#int))

Removes the criterion at the given index. Throws an exception if the given index is not valid.