MotionSession Class — NXOpen Python API Reference 12.0.0 documentation

# MotionSession Class

class `NXOpen.Motion.``MotionSession`

  Bases: `object`

  Represents motion session

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

  New in version NX5.0.0.

  “Environments”, “Returns the `NXOpen.Motion.MotionEnvironment` belonging to this part ” “PostProcess”, “Returns the `NXOpen.Motion.PostProcess` belonging to this part ” “MotionMethods”, “Returns the `NXOpen.Motion.MotionMethods`belonging to this part " ":ref:`NXOpen.Motion.MotionSession.MechanismImport`”, “Returns the `NXOpen.Motion.MechanismImport` object belonging to this part ” “MechanismExport”, “Returns the `NXOpen.Motion.MechanismExport` object belonging to this part “

# Methods

Method | Description
--- | ---
CloneSimulation | Clones the Simulation.
ConstraintsToMotionObject | Converts mating conditions and constraints to links and joints
CreateNamingSimulation | Creates the Non-master Simulation in NX Manager mode with an input name.
CreatePhysicsConversionBuilder | Creates a `NXOpen.Motion.PhysicsConversionBuilder`
CreateSimulation | Creates the Simulation.
DeleteSimulation | Deletes the Simulation.
DirectOpenSimulation | Opens the Simulation directly.
ExportProcessSimulateKinematics | Exports kinematics for Process Simulate
FixLinkToGround | Fixes the link to ground
GetFullName | Gets the full name for a scenario name, which is located in motion subfolder of master part
GetFunctionReferencedMotionObjects | Gets function referenced motion objects.
GetFunctionReferencingMotionObjects | Gets function referencing motion objects.
GetReferencedFunctions | Gets the referenced functions
GetReferencedMotionObjects | Gets the referenced motion objects.
GetReferencingFunctions | Gets the referencing functions
GetReferencingMotionObjects | Gets the referencing motion objects.
GetScenarioNames | Gets all scenario names from motion subfolder of master part
InitializeMechanisms | Initializes the mech
InitializeSimulation | Initializes the motion simulation context for the loaded motion part
ReparentSimulation | Reparents the Simulation.

## Environments

`MotionSession.``Environments`

  Returns the `NXOpen.Motion.MotionEnvironment` belonging to this part

  Signature `Environments`

  New in version NX7.5.0.

  Returns: |
  Return type: | `NXOpen.Motion.MotionEnvironment`

## PostProcess

`MotionSession.``PostProcess`

  Returns the `NXOpen.Motion.PostProcess` belonging to this part

  Signature `PostProcess`

  New in version NX7.5.0.

  Returns: |
  Return type: | `NXOpen.Motion.PostProcess`

## MotionMethods

`MotionSession.``MotionMethods`

  Returns the :py:class:`NXOpen.Motion.MotionMethods`belonging to this part

  Signature `MotionMethods`

  New in version NX8.0.0.

  Returns: |
  Return type: | `NXOpen.Motion.MotionMethods`

## MechanismImport

`MotionSession.``MechanismImport`

  Returns the `NXOpen.Motion.MechanismImport` object belonging to this part

  Signature `MechanismImport`

  New in version NX12.0.0.

  Returns: |
  Return type: | `NXOpen.Motion.MechanismImport`

## MechanismExport

`MotionSession.``MechanismExport`

  Returns the `NXOpen.Motion.MechanismExport` object belonging to this part

  Signature `MechanismExport`

  New in version NX12.0.0.

  Returns: |
  Return type: | `NXOpen.Motion.MechanismExport`

# Method Detail

## CloneSimulation

`MotionSession.``CloneSimulation`

  Clones the Simulation.

  Signature `CloneSimulation(masterPart, motionSimName)`

  Parameters:

  - masterPart (`NXOpen.NXObject`) – the master part
  - motionSimName (str) – motion simulation part which ready to be cloned

  Returns: | new motion simulation part name
  Return type: | str

  New in version NX5.0.0.

  License requirements: mechanisms (“MECHANISMS”)

## ConstraintsToMotionObject

`MotionSession.``ConstraintsToMotionObject`

  Converts mating conditions and constraints to links and joints

  Signature `ConstraintsToMotionObject(scenarioPart, masterPart)`

  Parameters:

  - scenarioPart (`NXOpen.NXObject`) – the scenario part object
  - masterPart (`NXOpen.NXObject`) – the master part object

  Returns: | the link which will be fixed to ground
  Return type: | `NXOpen.NXObject`

  New in version NX6.0.1.

  License requirements: mechanisms (“MECHANISMS”)

## CreateNamingSimulation

`MotionSession.``CreateNamingSimulation`

  Creates the Non-master Simulation in NX Manager mode with an input name.

  Signature `CreateNamingSimulation(masterPart, inputSimName)`

  Parameters:

  - masterPart (`NXOpen.NXObject`) – the master_part
  - inputSimName (str) – the input simulation name

  Returns: | the created motion simulation part name
  Return type: | str

  New in version NX8.0.0.

  License requirements: mechanisms (“MECHANISMS”)

## CreatePhysicsConversionBuilder

`MotionSession.``CreatePhysicsConversionBuilder`

  Creates a `NXOpen.Motion.PhysicsConversionBuilder`

  Signature `CreatePhysicsConversionBuilder(scenarioPart)`

  Parameters: | scenarioPart (`NXOpen.NXObject`) –
  Returns: |
  Return type: | `NXOpen.Motion.PhysicsConversionBuilder`

  New in version NX8.0.0.

  License requirements: mechanisms (“MECHANISMS”)

## CreateSimulation

`MotionSession.``CreateSimulation`

  Creates the Simulation.

  Signature `CreateSimulation(masterPart)`

  Parameters: | masterPart (`NXOpen.NXObject`) – the master_part
  Returns: | created motion simulation part name
  Return type: | str

  New in version NX5.0.0.

  Deprecated since version NX12.0.0: Use `NXOpen.FileNew` and `NXOpen.Motion.MotionSession.InitializeSimulation()`

  License requirements: mechanisms (“MECHANISMS”)

## DeleteSimulation

`MotionSession.``DeleteSimulation`

  Deletes the Simulation.

  Signature `DeleteSimulation(masterPart, motionSimName)`

  Parameters:

  - masterPart (`NXOpen.NXObject`) – the master_part
  - motionSimName (str) – motion simulation part which ready to be deleted

  New in version NX5.0.0.

  Deprecated since version NX12.0.0: Removed without replacement.

  License requirements: mechanisms (“MECHANISMS”)

## DirectOpenSimulation

`MotionSession.``DirectOpenSimulation`

  Opens the Simulation directly.

  Signature `DirectOpenSimulation(motionSimName)`

  Parameters: | motionSimName (str) – motion simulation part name

  New in version NX5.0.0.

  Deprecated since version NX12.0.0: Use `NXOpen.PartCollection.OpenDisplay()` and `NXOpen.Motion.MotionSession.InitializeSimulation()`

  License requirements: mechanisms (“MECHANISMS”)

## ExportProcessSimulateKinematics

`MotionSession.``ExportProcessSimulateKinematics`

  Exports kinematics for Process Simulate

  Signature `ExportProcessSimulateKinematics()`

  New in version NX8.5.0.

  License requirements: mechanisms (“MECHANISMS”)

## FixLinkToGround

`MotionSession.``FixLinkToGround`

  Fixes the link to ground

  Signature `FixLinkToGround(link)`

  Parameters: | link (`NXOpen.NXObject`) – the link object
  Returns: | the joint object created
  Return type: | `NXOpen.NXObject`

  New in version NX6.0.1.

  License requirements: mechanisms (“MECHANISMS”)

## GetFullName

`MotionSession.``GetFullName`

  Gets the full name for a scenario name, which is located in motion subfolder of master part

  Signature `GetFullName(masterPart, scenarioName)`

  Parameters:

  - masterPart (`NXOpen.NXObject`) – the master part object
  - scenarioName (str) – scenario name to check (with or without extension)

  Returns: | full path to the file
  Return type: | str

  New in version NX7.0.0.

  License requirements: mechanisms (“MECHANISMS”)

## GetFunctionReferencedMotionObjects

`MotionSession.``GetFunctionReferencedMotionObjects`

  Gets function referenced motion objects.

  Signature `GetFunctionReferencedMotionObjects(scenarioPart, funcObject)`

  Parameters:

  - scenarioPart (`NXOpen.NXObject`) –
  - funcObject (`NXOpen.Motion.MotionFunction`) –

  Returns: | The referenced motion objects
  Return type: | list of `NXOpen.NXObject`

  New in version NX11.0.0.

  License requirements: mechanisms (“MECHANISMS”)

## GetFunctionReferencingMotionObjects

`MotionSession.``GetFunctionReferencingMotionObjects`

  Gets function referencing motion objects.

  Signature `GetFunctionReferencingMotionObjects(scenarioPart, funcObject)`

  Parameters:

  - scenarioPart (`NXOpen.NXObject`) –
  - funcObject (`NXOpen.Motion.MotionFunction`) –

  Returns: | The referencing motion objects
  Return type: | list of `NXOpen.NXObject`

  New in version NX11.0.0.

  License requirements: mechanisms (“MECHANISMS”)

## GetReferencedFunctions

`MotionSession.``GetReferencedFunctions`

  Gets the referenced functions

  Signature `GetReferencedFunctions(scenarioPart, originObject)`

  Parameters:

  - scenarioPart (`NXOpen.NXObject`) –
  - originObject (`NXOpen.NXObject`) – Non-function motion object.

  Returns: | The referenced functions
  Return type: | list of `NXOpen.Motion.MotionFunction`

  New in version NX11.0.0.

  License requirements: mechanisms (“MECHANISMS”)

## GetReferencedMotionObjects

`MotionSession.``GetReferencedMotionObjects`

  Gets the referenced motion objects.

  Signature `GetReferencedMotionObjects(scenarioPart, originObject)`

  Parameters:

  - scenarioPart (`NXOpen.NXObject`) –
  - originObject (`NXOpen.NXObject`) – Non-function motion object. For function, please use `Motion.MotionSession.GetReferencedMotionObjects()`.

  Returns: | The referenced motion objects
  Return type: | list of `NXOpen.NXObject`

  New in version NX11.0.0.

  License requirements: mechanisms (“MECHANISMS”)

## GetReferencingFunctions

`MotionSession.``GetReferencingFunctions`

  Gets the referencing functions

  Signature `GetReferencingFunctions(scenarioPart, originObject)`

  Parameters:

  - scenarioPart (`NXOpen.NXObject`) –
  - originObject (`NXOpen.NXObject`) – Non-function motion object.

  Returns: | The referencing functions
  Return type: | list of `NXOpen.Motion.MotionFunction`

  New in version NX11.0.0.

  License requirements: mechanisms (“MECHANISMS”)

## GetReferencingMotionObjects

`MotionSession.``GetReferencingMotionObjects`

  Gets the referencing motion objects.

  Signature `GetReferencingMotionObjects(scenarioPart, originObject)`

  Parameters:

  - scenarioPart (`NXOpen.NXObject`) –
  - originObject (`NXOpen.NXObject`) – Non-function motion object. For function, please use `Motion.MotionSession.GetReferencingMotionObjects()`.

  Returns: | The referencing motion objects.
  Return type: | list of `NXOpen.NXObject`

  New in version NX11.0.0.

  License requirements: mechanisms (“MECHANISMS”)

## GetScenarioNames

`MotionSession.``GetScenarioNames`

  Gets all scenario names from motion subfolder of master part

  Signature `GetScenarioNames(masterPart)`

  Parameters: | masterPart (`NXOpen.NXObject`) – the master part object
  Returns: | scenario names
  Return type: | list of str

  New in version NX7.0.0.

  License requirements: mechanisms (“MECHANISMS”)

## InitializeMechanisms

`MotionSession.``InitializeMechanisms`

  Initializes the mech

  Signature `InitializeMechanisms()`

  New in version NX6.0.0.

  Deprecated since version NX12.0.0: Use `NXOpen.Motion.MotionSession.InitializeSimulation()`

  License requirements: mechanisms (“MECHANISMS”)

## InitializeSimulation

`MotionSession.``InitializeSimulation`

  Initializes the motion simulation context for the loaded motion part

  Signature `InitializeSimulation(simulationPart)`

  Parameters: | simulationPart (`NXOpen.Part`) – the loaded motion simulation part

  New in version NX12.0.0.

  License requirements: mechanisms (“MECHANISMS”)

## ReparentSimulation

`MotionSession.``ReparentSimulation`

  Reparents the Simulation.

  Signature `ReparentSimulation(motionSimFullName, destinationDirectory)`

  Parameters:

  - motionSimFullName (str) – motion simulation full name
  - destinationDirectory (str) – destination directory

  New in version NX5.0.0.

  Deprecated since version NX12.0.0: Removed without replacement.

  License requirements: mechanisms (“MECHANISMS”)