MechanismImport Class — NXOpen Python API Reference 12.0.0 documentation

# MechanismImport Class

class `NXOpen.Motion.``MechanismImport`

  Bases: `object`

  Represents a Mechanism Import object used to import a Motion model from a text file.

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

  New in version NX12.0.0.

# Methods

Method | Description
--- | ---
ImportFromSubassembly | Imports a Motion Definition (.
ImportMdef | Imports a Motion Definition (.
ImportXML | Imports a Motion Definition (.

# Enumerations

MechanismImportNamingRule Enumeration | Naming Rule type to modify imported object’s name

# Method Detail

## ImportFromSubassembly

`MechanismImport.``ImportFromSubassembly`

  Imports a Motion Definition (.

  sim) Part.

  Signature `ImportFromSubassembly(compOcc, motionPart, workPart, namingRule, appendixString, reportToInfoWindow, abortOnFailure)`

  Parameters:

  - compOcc (`NXOpen.Assemblies.Component`) – the selected component part occ
  - motionPart (`NXOpen.Part`) – the motion part which the mechanism objects are imported from
  - workPart (`NXOpen.Part`) – the current work part
  - namingRule (`NXOpen.Motion.MechanismImportNamingRule`) – enum to rule the naming behavior of the imported objects
  - appendixString (str) – string to add when NamingRule is AddPrefix or AddSuffix
  - reportToInfoWindow (bool) – Flag to report import status in the information window
  - abortOnFailure (bool) – Flag to rule whether to abort the process when there is error occurrs

  New in version NX12.0.0.

  License requirements: mechanisms (“MECHANISMS”)

## ImportMdef

`MechanismImport.``ImportMdef`

  Imports a Motion Definition (.

  mdef) file.

  Signature `ImportMdef(workPart, fileName, namingRule, addString, reportToInfoWindow, replaceExistingElements)`

  Parameters:

  - workPart (`NXOpen.NXObject`) –
  - fileName (str) – Full path to the .mdef file
  - namingRule (`NXOpen.Motion.MechanismImportNamingRule`) –
  - addString (str) – string to add when NamingRule is AddPrefix or AddSuffix
  - reportToInfoWindow (bool) – Flag to report import status in the information window
  - replaceExistingElements (bool) – Flag to replace elements with same names

  New in version NX12.0.0.

  License requirements: mechanisms (“MECHANISMS”)

## ImportXML

`MechanismImport.``ImportXML`

  Imports a Motion Definition (.

  XML) file.

  Signature `ImportXML(workPart, fileName, namingRule, appendixString, reportToInfoWindow)`

  Parameters:

  - workPart (`NXOpen.Part`) –
  - fileName (str) – Full path to the .xml file
  - namingRule (`NXOpen.Motion.MechanismImportNamingRule`) –
  - appendixString (str) – string to add when NamingRule is AddPrefix or AddSuffix
  - reportToInfoWindow (bool) – Flag to report import status in the information window

  New in version NX12.0.0.

  License requirements: mechanisms (“MECHANISMS”)