PdmSession Class — NXOpen Python API Reference 12.0.0 documentation

# PdmSession Class

class `NXOpen.PDM.``PdmSession`

  Bases: `object`

  Represents the NX Manager session

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

  New in version NX7.5.0.

  “AttributeGroupDescriptions”, “Returns a collection of `NXOpen.PDM.AttributeGroupDescription` objects representing
    attribute group types. The collection contains attribute group descriptions for `NXOpen.PDM.IAttributeGroupOwner` objects loaded within the NX session. Use the `NXOpen.PDM.IAttributeGroupOwner.GetAttributeGroupDescriptions()` to get the specific attribute group descriptions for an attribute group owner. “

  “PartOperationImportObserver”, “Returns the `NXOpen.PDM.PartOperationImportObserver` belonging to this session ” “SaveAsReviseObserver”, “Returns the `NXOpen.PDM.SaveAsReviseObserver` belonging to this session “

# Methods

Method | Description
--- | ---
CreateCopyOperationBuilder | Returns a new `NXOpen.PDM.PartOperationCopyBuilder` object
CreateCreateOperationBuilder | Returns a new `NXOpen.PDM.PartOperationCreateBuilder` object
CreateExportWorksetForReferenceBuilder | Creates a new `NXOpen.PDM.ExportWorksetForReferenceBuilder` object used for exporting workset outside Teamcenter for reference.
CreateImportOperationBuilder | Returns a new `NXOpen.PDM.PartOperationImportBuilder` object
CreateMakeUniqueOperationBuilder | Returns a new `NXOpen.PDM.PartOperationMakeUniqueBuilder` object
CreateObjectCreateBuilder | Returns a new `NXOpen.PDM.ObjectCreateBuilder` object
CreateOperationBuilder | Returns a new `NXOpen.PDM.PartOperationBuilder` object
CreatePartOperationAttributePropertiesBuilder | Creates a new `NXOpen.PDM.PartOperationAttributePropertiesBuilder` object.
CreatePartOperationValidationPropertiesBuilder | Creates a new `AttributePropertiesBuilder` object.
CreateSmartSaveBuilder | Creates a new `SmartSaveBuilder` object.
CreateSmartSaveBuilderWithContext | Creates a new `SmartSaveBuilder` object.
CreateSmartSaveContext | Creates a new `SmartSaveContext` object.
GetDatabaseObjectManager | Gets the `NXOpen.PDM.DatabaseObjectManager` object.
GetSsoSettings | Returns the SSO credentials, if SSO is available The client applications can use these settings to connect to the same Tcserver that NX is using.
GetTcserverSettings | Returns the connect string and discriminator used by NX session to connect to the Tcserver.
NewCaeFileContainer | Returns a new `NXOpen.PDM.CAEFileContainer` object
NewFileManagement | Returns a new `NXOpen.PDM.FileManagement` object
SetActiveEngineeringChangeNotice | Sets active ECN for the session.
SetDefaultFolder | Sets default folder.

## AttributeGroupDescriptions

`PdmSession.``AttributeGroupDescriptions`

  Returns a collection of `NXOpen.PDM.AttributeGroupDescription` objects representing attribute group types.

  The collection contains attribute group descriptions for `NXOpen.PDM.IAttributeGroupOwner` objects loaded within the NX session. Use the `NXOpen.PDM.IAttributeGroupOwner.GetAttributeGroupDescriptions()` to get the specific attribute group descriptions for an attribute group owner.

  Signature `AttributeGroupDescriptions`

  New in version NX9.0.0.

  Returns: |
  Return type: | `NXOpen.PDM.AttributeGroupDescriptionCollection`

## PartOperationImportObserver

`PdmSession.``PartOperationImportObserver`

  Returns the `NXOpen.PDM.PartOperationImportObserver` belonging to this session

  Signature `PartOperationImportObserver`

  New in version NX10.0.0.

  Returns: |
  Return type: | `NXOpen.PDM.PartOperationImportObserver`

## SaveAsReviseObserver

`PdmSession.``SaveAsReviseObserver`

  Returns the `NXOpen.PDM.SaveAsReviseObserver` belonging to this session

  Signature `SaveAsReviseObserver`

  New in version NX11.0.0.

  Returns: |
  Return type: | `NXOpen.PDM.SaveAsReviseObserver`

# Method Detail

## CreateCopyOperationBuilder

`PdmSession.``CreateCopyOperationBuilder`

  Returns a new `NXOpen.PDM.PartOperationCopyBuilder` object

  Signature `CreateCopyOperationBuilder(operation)`

  Parameters: | operation (`NXOpen.PDM.PartOperationBuilderOperationType`) –
  Returns: |
  Return type: | `NXOpen.PDM.PartOperationCopyBuilder`

  New in version NX10.0.0.

  License requirements: None.

## CreateCreateOperationBuilder

`PdmSession.``CreateCreateOperationBuilder`

  Returns a new `NXOpen.PDM.PartOperationCreateBuilder` object

  Signature `CreateCreateOperationBuilder(operation)`

  Parameters: | operation (`NXOpen.PDM.PartOperationBuilderOperationType`) –
  Returns: |
  Return type: | `NXOpen.PDM.PartOperationCreateBuilder`

  New in version NX10.0.0.

  License requirements: None.

## CreateExportWorksetForReferenceBuilder

`PdmSession.``CreateExportWorksetForReferenceBuilder`

  Creates a new `NXOpen.PDM.ExportWorksetForReferenceBuilder` object used for exporting workset outside Teamcenter for reference.

  Signature `CreateExportWorksetForReferenceBuilder(workset)`

  Parameters: | workset (`NXOpen.BasePart`) – workset assembly to export
  Returns: |
  Return type: | `NXOpen.PDM.ExportWorksetForReferenceBuilder`

  New in version NX11.0.0.

  License requirements: assemblies (“ASSEMBLIES MODULE”)

## CreateImportOperationBuilder

`PdmSession.``CreateImportOperationBuilder`

  Returns a new `NXOpen.PDM.PartOperationImportBuilder` object

  Signature `CreateImportOperationBuilder()`

  Returns: |
  Return type: | `NXOpen.PDM.PartOperationImportBuilder`

  New in version NX10.0.0.

  License requirements: None.

## CreateMakeUniqueOperationBuilder

`PdmSession.``CreateMakeUniqueOperationBuilder`

  Returns a new `NXOpen.PDM.PartOperationMakeUniqueBuilder` object

  Signature `CreateMakeUniqueOperationBuilder(part)`

  Parameters: | part (`NXOpen.BasePart`) –
  Returns: |
  Return type: | `NXOpen.PDM.PartOperationMakeUniqueBuilder`

  New in version NX10.0.0.

  License requirements: assemblies (“ASSEMBLIES MODULE”)

## CreateObjectCreateBuilder

`PdmSession.``CreateObjectCreateBuilder`

  Returns a new `NXOpen.PDM.ObjectCreateBuilder` object

  Signature `CreateObjectCreateBuilder(tcTypes, baseTCTypes)`

  Parameters:

  - tcTypes (list of str) –
  - baseTCTypes (list of str) –

  Returns: |
  Return type: | `NXOpen.PDM.ObjectCreateBuilder`

  New in version NX10.0.0.

  License requirements: None.

## CreateOperationBuilder

`PdmSession.``CreateOperationBuilder`

  Returns a new `NXOpen.PDM.PartOperationBuilder` object

  Signature `CreateOperationBuilder(operation)`

  Parameters: | operation (`NXOpen.PDM.PartOperationBuilderOperationType`) –
  Returns: |
  Return type: | `NXOpen.PDM.PartOperationBuilder`

  New in version NX9.0.0.

  Deprecated since version NX10.0.0: Use `NXOpen.PDM.PdmSession.CreateCopyOperationBuilder()` instead

  License requirements: None.

## CreatePartOperationAttributePropertiesBuilder

`PdmSession.``CreatePartOperationAttributePropertiesBuilder`

  Creates a new `NXOpen.PDM.PartOperationAttributePropertiesBuilder` object.

  Signature `CreatePartOperationAttributePropertiesBuilder(objects)`

  Parameters: | objects (list of `NXOpen.NXObject`) – the array of objects
  Returns: |
  Return type: | `NXOpen.PDM.PartOperationAttributePropertiesBuilder`

  New in version NX10.0.0.

  License requirements: assemblies (“ASSEMBLIES MODULE”)

## CreatePartOperationValidationPropertiesBuilder

`PdmSession.``CreatePartOperationValidationPropertiesBuilder`

  Creates a new `AttributePropertiesBuilder` object.

  Signature `CreatePartOperationValidationPropertiesBuilder(objects)`

  Parameters: | objects (list of `NXOpen.NXObject`) – the array of objects
  Returns: |
  Return type: | `NXOpen.AttributePropertiesBuilder`

  New in version NX10.0.0.

  License requirements: assemblies (“ASSEMBLIES MODULE”)

## CreateSmartSaveBuilder

`PdmSession.``CreateSmartSaveBuilder`

  Creates a new `SmartSaveBuilder` object.

  Signature `CreateSmartSaveBuilder(saveType)`

  Parameters: | saveType (`NXOpen.PDM.SmartSaveBuilderSaveType`) –
  Returns: |
  Return type: | `NXOpen.PDM.SmartSaveBuilder`

  New in version NX11.0.0.

  Deprecated since version NX11.0.1: Use `NXOpen.PDM.PdmSession.CreateSmartSaveBuilderWithContext()` instead

  License requirements: None.

## CreateSmartSaveBuilderWithContext

`PdmSession.``CreateSmartSaveBuilderWithContext`

  Creates a new `SmartSaveBuilder` object.

  Signature `CreateSmartSaveBuilderWithContext(smartSaveContext)`

  Parameters: | smartSaveContext (`NXOpen.PDM.SmartSaveContext`) –
  Returns: |
  Return type: | `NXOpen.PDM.SmartSaveBuilder`

  New in version NX11.0.1.

  License requirements: None.

## CreateSmartSaveContext

`PdmSession.``CreateSmartSaveContext`

  Creates a new `SmartSaveContext` object.

  Signature `CreateSmartSaveContext(saveType)`

  Parameters: | saveType (`NXOpen.PDM.SmartSaveBuilderSaveType`) –
  Returns: |
  Return type: | `NXOpen.PDM.SmartSaveContext`

  New in version NX11.0.1.

  License requirements: None.

## GetDatabaseObjectManager

`PdmSession.``GetDatabaseObjectManager`

  Gets the `NXOpen.PDM.DatabaseObjectManager` object.

  Signature `GetDatabaseObjectManager()`

  Returns: |
  Return type: | `NXOpen.PDM.DatabaseObjectManager`

  New in version NX11.0.0.

  License requirements: None.

## GetSsoSettings

`PdmSession.``GetSsoSettings`

  Returns the SSO credentials, if SSO is available The client applications can use these settings to connect to the same Tcserver that NX is using.

  Signature `GetSsoSettings()`

  Returns: | a tuple
  Return type: | A tuple consisting of (isSsoEnabled, ssoServerUrl, ssoAppID) isSsoEnabled is a bool. if SSO is enabled ssoServerUrl is a str. the SSO server URL ssoAppID is a str. the SSO app id

  New in version NX10.0.0.

  License requirements: None.

## GetTcserverSettings

`PdmSession.``GetTcserverSettings`

  Returns the connect string and discriminator used by NX session to connect to the Tcserver.

  The client applications can use these settings to connect to the same Tcserver that NX is using.

  Tcserver connect string: The connect string is path of the server hosting the services. The connect string for the different transport protocols will be in the following form: 4-Tier(HTTP mode): similar to http: 2-Tier(IIOP mode): The Tcserver IOR string

  Discriminator: The discriminator is a unique identifier and contains unique information related to a given TC server. This unique identifier (discriminator) is recognized by TC pool manager as the session number that ties the server process to the client. The discriminator functionality is part of the SOA package. The discriminator allows multiple clients to connect to the same TC server. In 2-Tier(IIOP mode), the discriminator will be an empty string.

  To connect to the same Tcserver as NX, the client can create a Teamcenter::Soa::Client::Connection object using the connect string and then use the Teamcenter::Services::Core::SessionService to login to Teamcenter Server with the discriminator and the connection object. More information about connecting to the Teamcenter server can be found in the TC SOA API Documentation.

  Signature `GetTcserverSettings()`

  Returns: | a tuple
  Return type: | A tuple consisting of (connectString, discriminator) connectString is a str. the connection string discriminator is a str. the discriminator

  New in version NX7.5.0.

  License requirements: None.

## NewCaeFileContainer

`PdmSession.``NewCaeFileContainer`

  Returns a new `NXOpen.PDM.CAEFileContainer` object

  Signature `NewCaeFileContainer()`

  Returns: |
  Return type: | `NXOpen.PDM.CAEFileContainer`

  New in version NX8.5.0.

  License requirements: None.

## NewFileManagement

`PdmSession.``NewFileManagement`

  Returns a new `NXOpen.PDM.FileManagement` object

  Signature `NewFileManagement()`

  Returns: |
  Return type: | `NXOpen.PDM.FileManagement`

  New in version NX7.5.4.

  License requirements: None.

## SetActiveEngineeringChangeNotice

`PdmSession.``SetActiveEngineeringChangeNotice`

  Sets active ECN for the session.

  The input will be in the format of ECN ID and the ECN Revision ID.

  Signature `SetActiveEngineeringChangeNotice(part, ecnId, ecnRevsionId)`

  Parameters:

  - part (`NXOpen.Part`) – tag of the displayed part
  - ecnId (str) – ECN ItemID to be set
  - ecnRevsionId (str) – ECN ItemRevID to be set

  New in version NX12.0.0.

  License requirements: None.

## SetDefaultFolder

`PdmSession.``SetDefaultFolder`

  Sets default folder.

  The input default folder path in format &lt;username&gt;:&lt;folder&gt;:&lt;folder&gt;, where username is optional. In that case, in :&lt;folder&gt;:&lt;folder&gt;, the first : indicates Home, for example, :Newstuff, is the Newstuff folder in current user’s Home container

  Signature `SetDefaultFolder(defaultFolderSpec)`

  Parameters: | defaultFolderSpec (str) – Default folder path including default folder name to be set

  New in version NX7.5.0.

  License requirements: None.