SelectPartList Class — NXOpen Python API Reference 12.0.0 documentation

# SelectPartList Class

class `NXOpen.``SelectPartList`

  Bases: `NXOpen.TaggedObject`, `NXOpen.GeometricUtilities.IComponentBuilder`

  Represents a list of objects on a selection list.

  New in version NX5.0.0.

# Properties

Property | Description
--- | ---
DuplicatesAllowed | Returns whether duplicate objects are allowed in the selection list.
Size | Returns the number of objects in the list.
Tag | Returns the Tag for this object.

# Methods

Method | Description
--- | ---
Add | Adds an object to the list
Clear | Removes all items from the list.
Contains | Returns whether the specified object is already in the list or not.
GetArray | Returns the list of objects in the selection list.
GetSelectObjectArray | Returns the list of SelectObjects in the selection list.
Remove | Remove specified object from list.
RemoveArray | Remove specified objects from list.
SetArray | Sets the list of objects in the selection list.
Validate | Validate whether the inputs to the component are sufficient for commit to be called.

# Property Detail

## DuplicatesAllowed

`SelectPartList.``DuplicatesAllowed`

  Returns whether duplicate objects are allowed in the selection list.

  `-------------------------------------`

  Getter Method

  Signature `DuplicatesAllowed`

  Returns: | Whether duplicate objects are allowed
  Return type: | bool

  New in version NX5.0.0.

  License requirements: None.

## Size

`SelectPartList.``Size`

  Returns the number of objects in the list.

  `-------------------------------------`

  Getter Method

  Signature `Size`

  Returns: | number of objects in the list
  Return type: | int

  New in version NX5.0.0.

  License requirements: None.

# Method Detail

## Add

`SelectPartList.``Add`

  Overloaded method Add

  - `Add(object)`
  - `Add(objects)`
  - `Add(inputSelectionMethod)`
  - `Add(selection, view, point)`
  - `Add(snapType, selection1, view1, point1, selection2, view2, point2)`
  - `Add(selection, caeSubType, caeSubId)`

  `-------------------------------------`

  Adds an object to the list

  Signature `Add(object)`

  Parameters: | object (`NXOpen.Part`) – object to add
  Returns: | True if succesully added to list;

  False if the object was already a member of the list and duplicates are not allowed :rtype: bool

  New in version NX5.0.0.

  License requirements: None.

  `-------------------------------------`

  Adds a set of objects to the list

  Signature `Add(objects)`

  Parameters: | objects (list of `NXOpen.Part`) – objects to add
  Returns: | True if succesully added all objects to the list;

  False if there was at least one object that was already a member of the list and duplicates are not allowed :rtype: bool

  New in version NX5.0.0.

  License requirements: None.

  `-------------------------------------`

  Adds the objects from a SelectionMethod to the list

  Signature `Add(inputSelectionMethod)`

  Parameters: | inputSelectionMethod (`NXOpen.SelectionMethod`) – selection method containing objects to add
  Returns: | True if succesully added all objects to the list;

  False if there was at least one object that was already a member of the list and duplicates are not allowed :rtype: bool

  New in version NX6.0.0.

  License requirements: None.

  `-------------------------------------`

  Adds the object with the objects view and objects point

  Signature `Add(selection, view, point)`

  Parameters:

  - selection (`NXOpen.Part`) – selected object
  - view (`NXOpen.View`) – selected object view
  - point (`NXOpen.Point3d`) – selected object point

  Returns: | True if succesully added to list;

  False if the object was already a member of the list and duplicates are not allowed :rtype: bool

  New in version NX5.0.0.

  License requirements: None.

  `-------------------------------------`

  The object being selected with the objects view and objects point and snap information.

  Signature `Add(snapType, selection1, view1, point1, selection2, view2, point2)`

  Parameters:

  - snapType (`NXOpen.InferSnapTypeSnapType`) – snap point type
  - selection1 (`NXOpen.Part`) – first selected object
  - view1 (`NXOpen.View`) – first selected object view
  - point1 (`NXOpen.Point3d`) – first selected object point
  - selection2 (`NXOpen.Part`) – second selected object
  - view2 (`NXOpen.View`) – second selected object view
  - point2 (`NXOpen.Point3d`) – second selected object point

  Returns: | True if succesully added all objects to the list;

  False if there was at least one object that was already a member of the list and duplicates are not allowed :rtype: bool

  New in version NX5.0.0.

  License requirements: None.

  `-------------------------------------`

  The object being selected with CAE set object information.

  Signature `Add(selection, caeSubType, caeSubId)`

  Parameters:

  - selection (`NXOpen.Part`) – selected object
  - caeSubType (`NXOpen.CaeObjectTypeCaeSubType`) – CAE set object sub type
  - caeSubId (int) – CAE set object sub id

  Returns: | True if succesully added all objects to the list;

  False if there was at least one object that was already a member of the list and duplicates are not allowed :rtype: bool

  New in version NX5.0.0.

  Deprecated since version NX10.0.0: Use other versions of `NXOpen.SelectObjectList.Add()`.

  License requirements: None.

  `-------------------------------------`

## Clear

`SelectPartList.``Clear`

  Removes all items from the list.

  Signature `Clear()`

  New in version NX5.0.0.

  License requirements: None.

## Contains

`SelectPartList.``Contains`

  Returns whether the specified object is already in the list or not.

  Signature `Contains(object)`

  Parameters: | object (`NXOpen.Part`) – object to check
  Returns: | true if object is in the list, false otherwise
  Return type: | bool

  New in version NX5.0.0.

  License requirements: None.

## GetArray

`SelectPartList.``GetArray`

  Overloaded method GetArray

  - `GetArray()`
  - `GetArray()`

  `-------------------------------------`

  Returns the list of objects in the selection list.

  Signature `GetArray()`

  Returns: | items in list
  Return type: | list of `NXOpen.Part`

  New in version NX5.0.0.

  License requirements: None.

  `-------------------------------------`

## GetSelectObjectArray

`SelectPartList.``GetSelectObjectArray`

  Returns the list of SelectObjects in the selection list.

  Signature `GetSelectObjectArray()`

  Returns: | items in list
  Return type: | list of `NXOpen.SelectObject`

  New in version NX5.0.0.

  License requirements: None.

## Remove

`SelectPartList.``Remove`

  Overloaded method Remove

  - `Remove(object)`
  - `Remove(object, view)`
  - `Remove(snapType, selection1, view1, point1, selection2, view2, point2)`
  - `Remove(inputSelectionMethod)`

  `-------------------------------------`

  Remove specified object from list.

  Signature `Remove(object)`

  Parameters: | object (`NXOpen.Part`) – Object to remove
  Returns: | True if succesully removed from list;

  False if the object was not a member of the list :rtype: bool

  New in version NX5.0.0.

  License requirements: None.

  `-------------------------------------`

  Remove specified object from list.

  Signature `Remove(object, view)`

  Parameters:

  - object (`NXOpen.Part`) – Object to remove
  - view (`NXOpen.View`) – with this view

  Returns: | True if succesully removed from list;

  False if the object / view was not a member of the list :rtype: bool

  New in version NX6.0.0.

  License requirements: None.

  `-------------------------------------`

  Remove specified object from list.

  Signature `Remove(snapType, selection1, view1, point1, selection2, view2, point2)`

  Parameters:

  - snapType (`NXOpen.InferSnapTypeSnapType`) – snap point type
  - selection1 (`NXOpen.Part`) – first selected object
  - view1 (`NXOpen.View`) – first selected object view
  - point1 (`NXOpen.Point3d`) – first selected object point
  - selection2 (`NXOpen.Part`) – second selected object
  - view2 (`NXOpen.View`) – second selected object view
  - point2 (`NXOpen.Point3d`) – second selected object point

  Returns: | True if succesully removed from list;

  False if the object was not a member of the list :rtype: bool

  New in version NX6.0.0.

  License requirements: None.

  `-------------------------------------`

  Removes the objects from a SelectionMethod from the list

  Signature `Remove(inputSelectionMethod)`

  Parameters: | inputSelectionMethod (`NXOpen.SelectionMethod`) – selection method containing objects to add
  Returns: | True if succesully removed all objects from the list;

  False if there was at least one object that was not a member of the list :rtype: bool

  New in version NX6.0.0.

  License requirements: None.

  `-------------------------------------`

## RemoveArray

`SelectPartList.``RemoveArray`

  Remove specified objects from list.

  Signature `RemoveArray(objects)`

  Parameters: | objects (list of `NXOpen.Part`) – Objects to remove
  Returns: | True if succesully removed from list;

  False if the object was not a member of the list :rtype: bool

  New in version NX5.0.0.

  License requirements: None.

## SetArray

`SelectPartList.``SetArray`

  Overloaded method SetArray

  - `SetArray(objects)`
  - `SetArray(vars)`

  `-------------------------------------`

  Sets the list of objects in the selection list. This will clear any existing items in the list.

  Signature `SetArray(objects)`

  Parameters: | objects (list of `NXOpen.Part`) – items to put in the list

  New in version NX5.0.0.

  License requirements: None.

  `-------------------------------------`

## Validate

`SelectPartList.``Validate`

  Validate whether the inputs to the component are sufficient for commit to be called.

  If the component is not in a state to commit then an exception is thrown. For example, if the component requires you to set some property, this method will throw an exception if you haven’t set it. This method throws a not-yet-implemented NXException for some components.

  Signature `Validate()`

  Returns: | Was self validation successful
  Return type: | bool

  New in version NX3.0.1.

  License requirements: None.