SubsetRecipe Class — NXOpen Python API Reference 12.0.0 documentation

# SubsetRecipe Class

class `NXOpen.Assemblies.``SubsetRecipe`

  Bases: `object`

  A subset recipe is used by a `NXOpen.Assemblies.SubsetBuilder` to collect :py:class:`NXOpen.Assemblies.SearchTerm`s.

  The search terms specify the search that defines the contents of a `NXOpen.Assemblies.Subset`.

  To obtain an instance of this class, refer to `NXOpen.Assemblies.SubsetBuilder`

  New in version NX8.5.0.

# Methods

Method | Description
--- | ---
AddSearchTermBuilder | Add a `NXOpen.Assemblies.SearchTermBuilder` to the recipe.
CreateAttributeSearchTerm | Creates a `NXOpen.Assemblies.AttributeSearchTerm` and adds it to the recipe at the end of the list of search terms.
CreateBoxSearchTerm | Creates a `NXOpen.Assemblies.BoxSearchTerm` and adds it to the recipe at the end of the list of search terms.
CreateExplicitSearchTerm | Creates a `NXOpen.Assemblies.ExplicitSearchTerm` and adds it to the recipe at the end of the list of search terms.
CreateExplicitSearchTermGroup | Creates a `NXOpen.Assemblies.GroupSearchTerm` of :py:class:`NXOpen.Assemblies.ExplicitSearchTerm`s and adds it to the recipe at the end of the list of search terms.
CreatePartitionSearchTerm | Creates a `NXOpen.Assemblies.PartitionSearchTerm` and adds it to the recipe at the end of the list of search terms.
CreatePartitionSearchTermGroup | Creates a `NXOpen.Assemblies.GroupSearchTerm` of :py:class:`NXOpen.Assemblies.PartitionSearchTerm`s and adds it to the recipe at the end of the list of search terms.
CreatePlaneSearchTerm | Creates a `NXOpen.Assemblies.PlaneSearchTerm` and adds it to the recipe at the end of the list of search terms.
CreateProximitySearchTerm | Creates a `NXOpen.Assemblies.ProximitySearchTerm` and adds it to the recipe at the end of the list of search terms.
CreateRunContentProximitySearchTerm | Creates a `NXOpen.Assemblies.RunContentProximitySearchTerm` and adds it to the recipe at the end of the list of search terms.
DeleteSearchTerms | Removes the :py:class:`NXOpen.Assemblies.SearchTerm`s from the recipe and deletes them.
FindObject | Finds the `NXOpen.Assemblies.SearchTerm` with the given identifier as recorded in a journal.
GetAllSearchOptionSets | Gets the internal names of all option sets defined in database.
GetAllSearchOptions | Gets the internal names of all search options from specified option set as defined in database.
GetSearchOptionValue | Gets value of specified search option from given option set.
Group | Put the `NXOpen.Assemblies.SearchTerm`s in a new :py:class:`NXOpen.Assemblies.GroupSearchTerm`.
MoveDown | Move a `NXOpen.Assemblies.SearchTerm` down to another location in the recipe.
MoveUp | Move a `NXOpen.Assemblies.SearchTerm` up to another location in the recipe.
SetPartitionSearchTermLogic | Changes the search term include children logic of each :py:class:`NXOpen.Assemblies.PartitionSearchTerm`s passed in.
SetSearchOptionValue | Sets value of specified search option from given option set.
SetSearchTermLogic | Changes the search term logic of each :py:class:`NXOpen.Assemblies.SearchTerm`s passed in.
Ungroup | Any :py:class:`NXOpen.Assemblies.GroupSearchTerm`s in the input search terms will be removed from the recipe.

# Method Detail

## AddSearchTermBuilder

`SubsetRecipe.``AddSearchTermBuilder`

  Add a `NXOpen.Assemblies.SearchTermBuilder` to the recipe.

  When this search term builder is committed the search term will be added to the recipe at the end of the list of search terms.

  Signature `AddSearchTermBuilder(searchTermBuilder)`

  Parameters: | searchTermBuilder (`NXOpen.Assemblies.SearchTermBuilder`) –

  New in version NX8.5.0.

  License requirements: nx_4gd_integration (“4th Generation Design”)

## CreateAttributeSearchTerm

`SubsetRecipe.``CreateAttributeSearchTerm`

  Creates a `NXOpen.Assemblies.AttributeSearchTerm` and adds it to the recipe at the end of the list of search terms.

  Signature `CreateAttributeSearchTerm(logicType, queryName, entries, values)`

  Parameters:

  - logicType (`NXOpen.Assemblies.SearchTermSearchTermLogicType`) –
  - queryName (str) – Name of the saved query upon which this search term is based
  - entries (list of str) – search criteria entries
  - values (list of str) – search criteria values

  Returns: |
  Return type: | `NXOpen.Assemblies.AttributeSearchTerm`

  New in version NX8.5.0.

  License requirements: nx_4gd_integration (“4th Generation Design”)

## CreateBoxSearchTerm

`SubsetRecipe.``CreateBoxSearchTerm`

  Creates a `NXOpen.Assemblies.BoxSearchTerm` and adds it to the recipe at the end of the list of search terms.

  Signature `CreateBoxSearchTerm(logicType, overlapType, bottomCorner, topCorner, trueShapeRefinement)`

  Parameters:

  - logicType (`NXOpen.Assemblies.SearchTermSearchTermLogicType`) –
  - overlapType (`NXOpen.Assemblies.BoxSearchTermBoxOverlapLogicType`) –
  - bottomCorner (`NXOpen.Point3d`) – Vertex of zone in workset part coordinates
  - topCorner (`NXOpen.Point3d`) – Opposite vertex of zone in workset part coordinates
  - trueShapeRefinement (bool) – Apply TrueShape refinement to volume search

  Returns: |
  Return type: | `NXOpen.Assemblies.BoxSearchTerm`

  New in version NX8.5.0.

  License requirements: nx_4gd_integration (“4th Generation Design”)

## CreateExplicitSearchTerm

`SubsetRecipe.``CreateExplicitSearchTerm`

  Creates a `NXOpen.Assemblies.ExplicitSearchTerm` and adds it to the recipe at the end of the list of search terms.

  Signature `CreateExplicitSearchTerm(logicType, searchResultElement)`

  Parameters:

  - logicType (`NXOpen.Assemblies.SearchTermSearchTermLogicType`) –
  - searchResultElement (`NXOpen.Assemblies.SearchResultElement`) –

  Returns: |
  Return type: | `NXOpen.Assemblies.ExplicitSearchTerm`

  New in version NX8.5.0.

  License requirements: nx_4gd_integration (“4th Generation Design”)

## CreateExplicitSearchTermGroup

`SubsetRecipe.``CreateExplicitSearchTermGroup`

  Creates a `NXOpen.Assemblies.GroupSearchTerm` of :py:class:`NXOpen.Assemblies.ExplicitSearchTerm`s and adds it to the recipe at the end of the list of search terms.

  Signature `CreateExplicitSearchTermGroup(logicType, searchResultElements)`

  Parameters:

  - logicType (`NXOpen.Assemblies.SearchTermSearchTermLogicType`) –
  - searchResultElements (list of `NXOpen.Assemblies.SearchResultElement`) –

  Returns: |
  Return type: | `NXOpen.Assemblies.GroupSearchTerm`

  New in version NX8.5.0.

  License requirements: nx_4gd_integration (“4th Generation Design”)

## CreatePartitionSearchTerm

`SubsetRecipe.``CreatePartitionSearchTerm`

  Overloaded method CreatePartitionSearchTerm

  - `CreatePartitionSearchTerm(logicType, partition)`
  - `CreatePartitionSearchTerm(logicType, includeChildrenLogic, partition)`

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

  Creates a `NXOpen.Assemblies.PartitionSearchTerm` and adds it to the recipe at the end of the list of search terms. Child partitions of the partition being passed as a parameter are not included in the recipe.

  Signature `CreatePartitionSearchTerm(logicType, partition)`

  Parameters:

  - logicType (`NXOpen.Assemblies.SearchTermSearchTermLogicType`) –
  - partition (`NXOpen.Assemblies.Partition`) – The partition upon which this search term is based

  Returns: |
  Return type: | `NXOpen.Assemblies.PartitionSearchTerm`

  New in version NX8.5.0.

  Deprecated since version NX11.0.0: Use the `NXOpen.Assemblies.SubsetRecipe.CreatePartitionSearchTerm()` that gives specific control on whether or not to include children partition as well

  License requirements: nx_4gd_integration (“4th Generation Design”)

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

  Creates a `NXOpen.Assemblies.PartitionSearchTerm` and adds it to the recipe at the end of the list of search terms.

  Signature `CreatePartitionSearchTerm(logicType, includeChildrenLogic, partition)`

  Parameters:

  - logicType (`NXOpen.Assemblies.SearchTermSearchTermLogicType`) –
  - includeChildrenLogic (`NXOpen.Assemblies.PartitionSearchTermIncludeChildren`) –
  - partition (`NXOpen.Assemblies.Partition`) – The partition upon which this search term is based

  Returns: |
  Return type: | `NXOpen.Assemblies.PartitionSearchTerm`

  New in version NX11.0.0.

  License requirements: nx_4gd_integration (“4th Generation Design”)

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

## CreatePartitionSearchTermGroup

`SubsetRecipe.``CreatePartitionSearchTermGroup`

  Overloaded method CreatePartitionSearchTermGroup

  - `CreatePartitionSearchTermGroup(logicType, partitions)`
  - `CreatePartitionSearchTermGroup(logicType, includeChildrenLogic, partitions)`

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

  Creates a `NXOpen.Assemblies.GroupSearchTerm` of :py:class:`NXOpen.Assemblies.PartitionSearchTerm`s and adds it to the recipe at the end of the list of search terms. Child partitions of the partitions being passed as a parameter are not included in the recipe.

  Signature `CreatePartitionSearchTermGroup(logicType, partitions)`

  Parameters:

  - logicType (`NXOpen.Assemblies.SearchTermSearchTermLogicType`) –
  - partitions (list of `NXOpen.Assemblies.Partition`) –

  Returns: |
  Return type: | `NXOpen.Assemblies.GroupSearchTerm`

  New in version NX8.5.0.

  Deprecated since version NX11.0.0: Use the `NXOpen.Assemblies.SubsetRecipe.CreatePartitionSearchTermGroup()` that gives specific control on whether or not to include children partition as well

  License requirements: nx_4gd_integration (“4th Generation Design”)

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

  Creates a `NXOpen.Assemblies.GroupSearchTerm` of :py:class:`NXOpen.Assemblies.PartitionSearchTerm`s and adds it to the recipe at the end of the list of search terms.

  Signature `CreatePartitionSearchTermGroup(logicType, includeChildrenLogic, partitions)`

  Parameters:

  - logicType (`NXOpen.Assemblies.SearchTermSearchTermLogicType`) –
  - includeChildrenLogic (`NXOpen.Assemblies.PartitionSearchTermIncludeChildren`) –
  - partitions (list of `NXOpen.Assemblies.Partition`) –

  Returns: |
  Return type: | `NXOpen.Assemblies.GroupSearchTerm`

  New in version NX11.0.0.

  License requirements: nx_4gd_integration (“4th Generation Design”)

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

## CreatePlaneSearchTerm

`SubsetRecipe.``CreatePlaneSearchTerm`

  Creates a `NXOpen.Assemblies.PlaneSearchTerm` and adds it to the recipe at the end of the list of search terms.

  Signature `CreatePlaneSearchTerm(logicType, overlapType, normal, displacement, pointOnPlane, trueShapeRefinement)`

  Parameters:

  - logicType (`NXOpen.Assemblies.SearchTermSearchTermLogicType`) –
  - overlapType (`NXOpen.Assemblies.PlaneSearchTermPlaneOverlapLogicType`) –
  - normal (`NXOpen.Vector3d`) – Unitized plane normal
  - displacement (float) – Displacement in workset part units
  - pointOnPlane (`NXOpen.Point3d`) – Point On Plane in workset part coordinates
  - trueShapeRefinement (bool) – Apply TrueShape refinement to plane search

  Returns: |
  Return type: | `NXOpen.Assemblies.PlaneSearchTerm`

  New in version NX8.5.0.

  License requirements: nx_4gd_integration (“4th Generation Design”)

## CreateProximitySearchTerm

`SubsetRecipe.``CreateProximitySearchTerm`

  Creates a `NXOpen.Assemblies.ProximitySearchTerm` and adds it to the recipe at the end of the list of search terms.

  Signature `CreateProximitySearchTerm(logicType, seeds, distance, trueShapeRefinement)`

  Parameters:

  - logicType (`NXOpen.Assemblies.SearchTermSearchTermLogicType`) –
  - seeds (list of `NXOpen.Assemblies.SearchResultElement`) –
  - distance (float) – Distance in workset part units
  - trueShapeRefinement (bool) – Apply TrueShape refinement to proximity search

  Returns: |
  Return type: | `NXOpen.Assemblies.ProximitySearchTerm`

  New in version NX8.5.0.

  License requirements: nx_4gd_integration (“4th Generation Design”)

## CreateRunContentProximitySearchTerm

`SubsetRecipe.``CreateRunContentProximitySearchTerm`

  Creates a `NXOpen.Assemblies.RunContentProximitySearchTerm` and adds it to the recipe at the end of the list of search terms.

  Signature `CreateRunContentProximitySearchTerm(logicType, seedRunName, distance, trueShapeRefinement)`

  Parameters:

  - logicType (`NXOpen.Assemblies.SearchTermSearchTermLogicType`) –
  - seedRunName (str) – The contents of this Run will be seeds for the proximity
  - distance (float) – Distance in workset part units
  - trueShapeRefinement (bool) – Apply TrueShape refinement to proximity search

  Returns: |
  Return type: | `NXOpen.Assemblies.RunContentProximitySearchTerm`

  New in version NX11.0.0.

  License requirements: nx_4gd_integration (“4th Generation Design”)

## DeleteSearchTerms

`SubsetRecipe.``DeleteSearchTerms`

  Removes the :py:class:`NXOpen.Assemblies.SearchTerm`s from the recipe and deletes them.

  Signature `DeleteSearchTerms(searchTerms)`

  Parameters: | searchTerms (list of `NXOpen.Assemblies.SearchTerm`) –

  New in version NX8.5.0.

  License requirements: nx_4gd_integration (“4th Generation Design”)

## FindObject

`SubsetRecipe.``FindObject`

  Finds the `NXOpen.Assemblies.SearchTerm` with the given identifier as recorded in a journal.

  An object may not return the same value as its JournalIdentifier in different versions of the software. However newer versions of the software should find the same object when FindObject is passed older versions of its journal identifier. In general, this method should not be used in handwritten code and exists to support record and playback of journals.

  An exception will be thrown if no object can be found with the given journal identifier.

  Signature `FindObject(journalIdentifier)`

  Parameters: | journalIdentifier (str) – Name of the search term to be found
  Returns: | Search term found, or null if no such search term exists.
  Return type: | `NXOpen.Assemblies.SearchTerm`

  New in version NX8.5.0.

  License requirements: nx_4gd_integration (“4th Generation Design”)

## GetAllSearchOptionSets

`SubsetRecipe.``GetAllSearchOptionSets`

  Gets the internal names of all option sets defined in database.

  Signature `GetAllSearchOptionSets()`

  Returns: |
  Return type: | list of str

  New in version NX10.0.0.

  License requirements: None.

## GetAllSearchOptions

`SubsetRecipe.``GetAllSearchOptions`

  Gets the internal names of all search options from specified option set as defined in database.

  The option set should be internal name as defined in database. Use `NXOpen.Assemblies.SubsetRecipe.GetAllSearchOptionSets()` to get all the option sets internal name defined in database.

  Signature `GetAllSearchOptions(optionSet)`

  Parameters: | optionSet (str) –
  Returns: |
  Return type: | list of str

  New in version NX10.0.0.

  License requirements: None.

## GetSearchOptionValue

`SubsetRecipe.``GetSearchOptionValue`

  Gets value of specified search option from given option set.

  Both option set and search option should be internal name as defined in database. Use `NXOpen.Assemblies.SubsetRecipe.GetAllSearchOptionSets()` to get all the option set internal names defined in database. Use `NXOpen.Assemblies.SubsetRecipe.GetAllSearchOptions()` to get all the search option internal names defined in database.

  Signature `GetSearchOptionValue(optionSet, searchOption)`

  Parameters:

  - optionSet (str) –
  - searchOption (str) –

  Returns: |
  Return type: | bool

  New in version NX10.0.0.

  License requirements: None.

## Group

`SubsetRecipe.``Group`

  Put the `NXOpen.Assemblies.SearchTerm`s in a new :py:class:`NXOpen.Assemblies.GroupSearchTerm`.

  The group is placed in the recipe at the location of the first search term.

  Signature `Group(logicType, searchTerms)`

  Parameters:

  - logicType (`NXOpen.Assemblies.SearchTermSearchTermLogicType`) –
  - searchTerms (list of `NXOpen.Assemblies.SearchTerm`) –

  New in version NX8.5.0.

  License requirements: nx_4gd_integration (“4th Generation Design”)

## MoveDown

`SubsetRecipe.``MoveDown`

  Move a `NXOpen.Assemblies.SearchTerm` down to another location in the recipe.

  Signature `MoveDown(searchTerm)`

  Parameters: | searchTerm (`NXOpen.Assemblies.SearchTerm`) –

  New in version NX8.5.0.

  License requirements: nx_4gd_integration (“4th Generation Design”)

## MoveUp

`SubsetRecipe.``MoveUp`

  Move a `NXOpen.Assemblies.SearchTerm` up to another location in the recipe.

  Signature `MoveUp(searchTerm)`

  Parameters: | searchTerm (`NXOpen.Assemblies.SearchTerm`) –

  New in version NX8.5.0.

  License requirements: nx_4gd_integration (“4th Generation Design”)

## SetPartitionSearchTermLogic

`SubsetRecipe.``SetPartitionSearchTermLogic`

  Changes the search term include children logic of each :py:class:`NXOpen.Assemblies.PartitionSearchTerm`s passed in.

  Signature `SetPartitionSearchTermLogic(logicType, includeChildrenLogic, searchTerms)`

  Parameters:

  - logicType (`NXOpen.Assemblies.SearchTermSearchTermLogicType`) –
  - includeChildrenLogic (`NXOpen.Assemblies.PartitionSearchTermIncludeChildren`) –
  - searchTerms (list of `NXOpen.Assemblies.SearchTerm`) –

  New in version NX11.0.0.

  License requirements: nx_4gd_integration (“4th Generation Design”)

## SetSearchOptionValue

`SubsetRecipe.``SetSearchOptionValue`

  Sets value of specified search option from given option set.

  Both option set and search option should be internal name as defined in database. Use `NXOpen.Assemblies.SubsetRecipe.GetAllSearchOptionSets()` to get all the option set internal names defined in database. Use `NXOpen.Assemblies.SubsetRecipe.GetAllSearchOptions()` to get all the search option internal names defined in database.

  Signature `SetSearchOptionValue(optionSet, searchOption, optionValue)`

  Parameters:

  - optionSet (str) –
  - searchOption (str) –
  - optionValue (bool) –

  New in version NX10.0.0.

  License requirements: nx_4gd_integration (“4th Generation Design”)

## SetSearchTermLogic

`SubsetRecipe.``SetSearchTermLogic`

  Changes the search term logic of each :py:class:`NXOpen.Assemblies.SearchTerm`s passed in.

  Signature `SetSearchTermLogic(logicType, searchTerms)`

  Parameters:

  - logicType (`NXOpen.Assemblies.SearchTermSearchTermLogicType`) –
  - searchTerms (list of `NXOpen.Assemblies.SearchTerm`) –

  New in version NX8.5.0.

  License requirements: nx_4gd_integration (“4th Generation Design”)

## Ungroup

`SubsetRecipe.``Ungroup`

  Any :py:class:`NXOpen.Assemblies.GroupSearchTerm`s in the input search terms will be removed from the recipe.

  The members of the group will be re-parented as members of the group’s parent.

  Signature `Ungroup(searchTerms)`

  Parameters: | searchTerms (list of `NXOpen.Assemblies.SearchTerm`) –

  New in version NX8.5.0.

  License requirements: nx_4gd_integration (“4th Generation Design”)