RequirementCollection Class — NXOpen Python API Reference 12.0.0 documentation

# RequirementCollection Class

class `NXOpen.Validate.``RequirementCollection`

  Bases: `object`

  Represents an NX `NXOpen.Validate.RequirementCollection` object.

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

  New in version NX8.5.0.

# Properties

Property | Description
--- | ---
RevisionRule | Returns or sets the revision rule for requirement from Teamcenter

# Methods

Method | Description
--- | ---
CreateRequirementBuilder | Creates a `NXOpen.Validate.RequirementBuilder`
FindObject | Finds the `NXOpen.Validate.Requirement` with the given identifier.
LoadFromExternalSource | Loads `NXOpen.Validate.Requirement` from external source.
RefreshFromExternalSource | Refreshes the requirements from external source.

# Enumerations

RequirementCollectionSourceTypeOptions Enumeration | This enum represents the type of external source where requirement is defined

# Property Detail

## RevisionRule

`RequirementCollection.``RevisionRule`

  Returns or sets the revision rule for requirement from Teamcenter

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

  Getter Method

  Signature `RevisionRule`

  Returns: |
  Return type: | str

  New in version NX8.5.0.

  License requirements: None.

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

  Setter Method

  Signature `RevisionRule`

  Parameters: | rule (str) –

  New in version NX8.5.0.

  License requirements: None.

# Method Detail

## CreateRequirementBuilder

`RequirementCollection.``CreateRequirementBuilder`

  Creates a `NXOpen.Validate.RequirementBuilder`

  Signature `CreateRequirementBuilder(requirement)`

  Parameters: | requirement (`NXOpen.Validate.Requirement`) –
  Returns: |
  Return type: | `NXOpen.Validate.RequirementBuilder`

  New in version NX8.5.0.

  License requirements: None.

## FindObject

`RequirementCollection.``FindObject`

  Finds the `NXOpen.Validate.Requirement` with the given identifier.

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

  Signature `FindObject(id)`

  Parameters: | id (str) – The identifier of the `NXOpen.Validate.Requirement`
  Returns: | `NXOpen.Validate.Requirement` with the identifier
  Return type: | `NXOpen.Validate.Requirement`

  New in version NX8.5.0.

  License requirements: None.

## LoadFromExternalSource

`RequirementCollection.``LoadFromExternalSource`

  Loads `NXOpen.Validate.Requirement` from external source.

  The source can be local file, Teamcenter requirement item or item revision, and Teamcenter spreadsheet dataset for which the input sourceType is LocalFile, Teamcenter and TeamcenterFile respectively. <br/>

  Example inputs when sourceType is LocalFile

  > 1. source: “C:requirement.xml” or “C:requirement_spreadsheet.xls”
  > 2. revision: empty string
  > 3. project: “category_A” It’s a project node name in the source XML file or a sheet name in the source spreadsheet file.

  <br/>

  Example inputs when sourceType is Teamcenter

  If source is item revision 000084/A:

  > 1. source: “000084”
  > 2. revision: “A”
  > 3. project: empty string

  If source is item 000084:

  > 1. source: “000084”
  > 2. revision:empty string
  > 3. project: empty string

  <br/> Example inputs when sourceType is TeamcenterFile

  If source is a spreadsheet dataset in an item revision 000085/A:

  > 1. source: 000085
  > 2. revision: A
  > 3. project: “category_A” It’s a sheet name in the source spreadsheet.

  If source is a spreadsheet dataset in item 000085:

  > 1. source: “000085”
  > 2. revision: empty string
  > 3. project: “category_A” It’s a sheet name in the source spreadsheet.

  Signature `LoadFromExternalSource(sourceType, source, revision, project)`

  Parameters:

  - sourceType (`NXOpen.Validate.RequirementCollectionSourceTypeOptions`) – Type of the external source
  - source (str) – File full path if sourceType is LocalFile; Item id if sourceType is Teamcenter or TeamcenterFile.
  - revision (str) – Only needed if sourceType is Teamcenter or TeamcenterFile. Revision id if source is an item revision. Null if source is an item.
  - project (str) – Required if sourceType is LocalFile or TeamcenterFile. Project name if the source is a XML file; Sheet name if source is a spreadsheet file.

  New in version NX8.5.0.

  License requirements: None.

## RefreshFromExternalSource

`RequirementCollection.``RefreshFromExternalSource`

  Refreshes the requirements from external source.

  Signature `RefreshFromExternalSource(requirementTags)`

  Parameters: | requirementTags (list of `NXOpen.Validate.Requirement`) –

  New in version NX10.0.0.

  License requirements: None.