CloneObject Class — NXOpen Python API Reference 12.0.0 documentation

# CloneObject Class

class `NXOpen.Tooling.``CloneObject`

  Bases: `NXOpen.TransientObject`

  Represents the clone operation in Add Reusable Component Builder.

  To create an instance of this object use `NXOpen.Tooling.AddReusablePart.CreateCloneObject()`

  New in version NX6.0.0.

# Properties

Property | Description
--- | ---
CloneMethod | Returns or sets the clone method
OutputFolder | Returns or sets the destination folder

# Methods

Method | Description
--- | ---
AddAssembly | Adds the part/assembly to be cloned.
AddAssociatedPart | Adds other part (FEM, SIM part etc.
BuildAllClonePartItems | Builds the cloned part name (item id, item name, revision id) etc with no cloned part items output.
BuildClonePartItems | Builds the cloned part name (item id, item name, revision id) etc.
Commit | Performs the clone operation.
CreateClonePartItem | Creates a new clone part item.
Dispose | Destructs the class.
FindClonePartItem | Find the part item to be cloned by giving part name
FindClonePartItemByIndex | Find the part item to be cloned by giving index
RestorePartNumber | Restore start number.
SetDefaultItemType | Sets the default item type.
SetDefaultNameRule | Sets the name rule (refer to the Customer Defaults).
SetKeepItemType | Uses the item type which is same as original source item.
SetNameRule | Sets the name rule.
SetNextNumber | Sets the next number of clone object.
SetProjectName | Sets the project name.
SyncPartNumber | Synchronize the previous number with current.

# Property Detail

## CloneMethod

`CloneObject.``CloneMethod`

  Returns or sets the clone method

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

  Getter Method

  Signature `CloneMethod`

  Returns: |
  Return type: | `NXOpen.Tooling.ToolingClonemethod`

  New in version NX7.0.0.

  License requirements: None.

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

  Setter Method

  Signature `CloneMethod`

  Parameters: | cloneMethod (`NXOpen.Tooling.ToolingClonemethod`) –

  New in version NX7.0.0.

  License requirements: None.

## OutputFolder

`CloneObject.``OutputFolder`

  Returns or sets the destination folder

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

  Getter Method

  Signature `OutputFolder`

  Returns: |
  Return type: | str

  New in version NX6.0.0.

  License requirements: None.

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

  Setter Method

  Signature `OutputFolder`

  Parameters: | outputFolder (str) – If this folder is not set, it will use the folder of display part

  New in version NX6.0.0.

  License requirements: None.

# Method Detail

## AddAssembly

`CloneObject.``AddAssembly`

  Overloaded method AddAssembly

  - `AddAssembly(assemName)`
  - `AddAssembly(part)`

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

  Adds the part/assembly to be cloned.

  Signature `AddAssembly(assemName)`

  Parameters: | assemName (str) – Project assembly name

  New in version NX6.0.0.

  License requirements: None.

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

  Adds the part/assembly to be cloned.

  Signature `AddAssembly(part)`

  Parameters: | part (`NXOpen.Part`) – The assembly to be cloned.

  New in version NX11.0.2.

  License requirements: None.

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

## AddAssociatedPart

`CloneObject.``AddAssociatedPart`

  Adds other part (FEM, SIM part etc.

  ) to be cloned

  Signature `AddAssociatedPart(clonedPartName, fileType)`

  Parameters:

  - clonedPartName (str) – part name
  - fileType (`NXOpen.Tooling.ToolingCloneparttype`) – part file type

  New in version NX8.0.0.

  License requirements: None.

## BuildAllClonePartItems

`CloneObject.``BuildAllClonePartItems`

  Builds the cloned part name (item id, item name, revision id) etc with no cloned part items output.

  Signature `BuildAllClonePartItems()`

  New in version NX11.0.0.

  License requirements: None.

## BuildClonePartItems

`CloneObject.``BuildClonePartItems`

  Builds the cloned part name (item id, item name, revision id) etc.

  Signature `BuildClonePartItems()`

  Returns: | Cloned part items
  Return type: | list of `NXOpen.Tooling.ClonePart`

  New in version NX8.0.0.

  License requirements: None.

## Commit

`CloneObject.``Commit`

  Performs the clone operation.

  Signature `Commit()`

  Returns: |
  Return type: | str

  New in version NX6.0.0.

  License requirements: None.

## CreateClonePartItem

`CloneObject.``CreateClonePartItem`

  Creates a new clone part item.

  Signature `CreateClonePartItem(partName)`

  Parameters: | partName (str) – clone part name
  Returns: | the new `NXOpen.Tooling.ClonePart` instance
  Return type: | `NXOpen.Tooling.ClonePart`

  New in version NX6.0.0.

  License requirements: None.

## Dispose

`CloneObject.``Dispose`

  Destructs the class.

  Signature `Dispose()`

  New in version NX6.0.0.

  License requirements: None.

## FindClonePartItem

`CloneObject.``FindClonePartItem`

  Find the part item to be cloned by giving part name

  Signature `FindClonePartItem(partName)`

  Parameters: | partName (str) – clone part name
  Returns: | The returned `NXOpen.Tooling.ClonePart` instance
  Return type: | `NXOpen.Tooling.ClonePart`

  New in version NX6.0.0.

  License requirements: None.

## FindClonePartItemByIndex

`CloneObject.``FindClonePartItemByIndex`

  Find the part item to be cloned by giving index

  Signature `FindClonePartItemByIndex(index)`

  Parameters: | index (int) – index
  Returns: | The returned `NXOpen.Tooling.ClonePart` instance
  Return type: | `NXOpen.Tooling.ClonePart`

  New in version NX9.0.1.

  License requirements: None.

## RestorePartNumber

`CloneObject.``RestorePartNumber`

  Restore start number.

  Signature `RestorePartNumber()`

  New in version NX11.0.2.

  License requirements: None.

## SetDefaultItemType

`CloneObject.``SetDefaultItemType`

  Sets the default item type.

  Signature `SetDefaultItemType(defaultItemType)`

  Parameters: | defaultItemType (str) – Default item type

  New in version NX11.0.2.

  License requirements: None.

## SetDefaultNameRule

`CloneObject.``SetDefaultNameRule`

  Sets the name rule (refer to the Customer Defaults).

  Signature `SetDefaultNameRule(nameRule)`

  Parameters: | nameRule (str) – Naming rule

  New in version NX11.0.2.

  License requirements: None.

## SetKeepItemType

`CloneObject.``SetKeepItemType`

  Uses the item type which is same as original source item.

  Signature `SetKeepItemType(keepItemType)`

  Parameters: | keepItemType (bool) – Keep the same item type or not

  New in version NX11.0.2.

  License requirements: None.

## SetNameRule

`CloneObject.``SetNameRule`

  Sets the name rule.

  Signature `SetNameRule(nameRule)`

  Parameters: | nameRule (str) –

  New in version NX11.0.2.

  License requirements: None.

## SetNextNumber

`CloneObject.``SetNextNumber`

  Sets the next number of clone object.

  Signature `SetNextNumber(nextNumber)`

  Parameters: | nextNumber (int) – next number

  New in version NX9.0.1.

  License requirements: None.

## SetProjectName

`CloneObject.``SetProjectName`

  Sets the project name.

  Signature `SetProjectName(projName)`

  Parameters: | projName (str) –

  New in version NX11.0.2.

  License requirements: None.

## SyncPartNumber

`CloneObject.``SyncPartNumber`

  Synchronize the previous number with current.

  Signature `SyncPartNumber()`

  New in version NX11.0.2.

  License requirements: None.