ExpressionGroupCollection Class — NXOpen Python API Reference 12.0.0 documentation

# ExpressionGroupCollection Class

class `NXOpen.``ExpressionGroupCollection`

  Bases: `object`

  Represents a collection of expressions groups.

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

  New in version NX10.0.0.

# Properties

Property | Description
--- | ---
Active | Returns or sets the active expression group

# Methods

Method | Description
--- | ---
CheckName | Returns whether or not expression group name is valid.
Create | Creates an expression group
Delete | Deletes an array of one or more expression groups.
ExportExpressionGroupsToFile | Exports the expressions in an expression group to a text file, or, if ‘file_name’ is None, list the expressions in the listing window.
FindObject | Finds the `NXOpen.ExpressionGroup` with the given identifier as recorded in a journal.
GetAllExpressionGroupsInPart | Returns an array of all expression groups in a part .
GetDefault | Return the default expression group
GetGroupOfExpression | Returns expression group owner of an expression.
Rename | Changes the name of the expression group.
SetAllGroupsVisible | Make all expression groups visible

# Property Detail

## Active

`ExpressionGroupCollection.``Active`

  Returns or sets the active expression group

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

  Getter Method

  Signature `Active`

  Returns: | the active expression group
  Return type: | `NXOpen.ExpressionGroup`

  New in version NX10.0.0.

  License requirements: None.

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

  Setter Method

  Signature `Active`

  Parameters: | expressionGroup (`NXOpen.ExpressionGroup`) – the expression group to make active

  New in version NX10.0.0.

  License requirements: None.

# Method Detail

## CheckName

`ExpressionGroupCollection.``CheckName`

  Returns whether or not expression group name is valid.

  Signature `CheckName(name)`

  Parameters: | name (str) – the name of the expression group to check.
  Returns: | the status of the name check. True if name is okay
  Return type: | bool

  New in version NX10.0.0.

  License requirements: None.

## Create

`ExpressionGroupCollection.``Create`

  Creates an expression group

  Signature `Create(name)`

  Parameters: | name (str) – the name for the expression group.
  Returns: | the new expression group
  Return type: | `NXOpen.ExpressionGroup`

  New in version NX10.0.0.

  License requirements: None.

## Delete

`ExpressionGroupCollection.``Delete`

  Deletes an array of one or more expression groups.

  This method should be used when deleting an Expression group. DO NOT use the delete methods in Update.ja to delete expression groups

  Signature `Delete(expressionGroup)`

  Parameters: | expressionGroup (list of `NXOpen.ExpressionGroup`) – array of expression groups to delete

  New in version NX10.0.0.

  License requirements: None.

## ExportExpressionGroupsToFile

`ExpressionGroupCollection.``ExportExpressionGroupsToFile`

  Exports the expressions in an expression group to a text file, or, if ‘file_name’ is None, list the expressions in the listing window.

  Throws an exception if there is any error.

  NOTE: if the file already exists, an exception is thrown and the file is not overwritten.

  Signature `ExportExpressionGroupsToFile(expressionGroups, fileName, sortType)`

  Parameters:

  - expressionGroups (list of `NXOpen.ExpressionGroup`) –
  - fileName (str) – File name specification to export expressions into.
  - sortType (`NXOpen.ExpressionCollectionSortType`) – How to sort the exported expressions

  New in version NX10.0.0.

  License requirements: None.

## FindObject

`ExpressionGroupCollection.``FindObject`

  Finds the `NXOpen.ExpressionGroup` 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) – Identifier to be found
  Returns: | Expression found
  Return type: | `NXOpen.ExpressionGroup`

  New in version NX10.0.0.

  License requirements: None.

## GetAllExpressionGroupsInPart

`ExpressionGroupCollection.``GetAllExpressionGroupsInPart`

  Returns an array of all expression groups in a part .

  Signature `GetAllExpressionGroupsInPart()`

  Returns: | array of groupsexpression groups
  Return type: | list of `NXOpen.ExpressionGroup`

  New in version NX10.0.0.

  License requirements: None.

## GetDefault

`ExpressionGroupCollection.``GetDefault`

  Return the default expression group

  Signature `GetDefault()`

  Returns: | the default expression group
  Return type: | `NXOpen.ExpressionGroup`

  New in version NX10.0.0.

  License requirements: None.

## GetGroupOfExpression

`ExpressionGroupCollection.``GetGroupOfExpression`

  Returns expression group “owner” of an expression.

  Signature `GetGroupOfExpression(expression)`

  Parameters: | expression (`NXOpen.Expression`) – the expression to query
  Returns: | expression group of expression
  Return type: | `NXOpen.ExpressionGroup`

  New in version NX10.0.0.

  License requirements: None.

## Rename

`ExpressionGroupCollection.``Rename`

  Changes the name of the expression group.

  Signature `Rename(expressionGroup, newName)`

  Parameters:

  - expressionGroup (`NXOpen.ExpressionGroup`) – expression group to be renamed
  - newName (str) – new name of the expression group

  New in version NX11.0.0.

  License requirements: None.

## SetAllGroupsVisible

`ExpressionGroupCollection.``SetAllGroupsVisible`

  Make all expression groups visible

  Signature `SetAllGroupsVisible()`

  New in version NX10.0.0.

  License requirements: None.