Update Class — NXOpen Python API Reference 12.0.0 documentation

# Update Class

class `NXOpen.``Update`

  Bases: `object`

  Provides methods for update and delete.

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

  New in version NX3.0.0.

# Properties

Property | Description
--- | ---
AssemblyConstraintsDelay | Returns or sets the state of the assembly constraints delay flag.
ErrorList | Returns the list of all the errors that the Update module has encountered since the last time that the list was cleared.
InterpartDelay | Returns or sets the state of the interpart delay flag.
IntrapartPartModuleDelay | Returns or sets the delay status for intrapart part modules delays
ProductInterfaceDelay | Returns or sets the delay status for product interface delays

# Methods

Method | Description
--- | ---
AddObjectsToDeleteList | Adds objects to the global delete list.
AddToDeleteList | Adds objects to the global delete list.
ClearDeleteList | Clears the contents of the global delete list.
ClearErrorList | Clears the update error list.
DoAssemblyConstraintsUpdate | Performs an assembly constraints update.
DoAssemblyConstraintsUpdateInPart | Performs an assembly constraints update.
DoInterpartUpdate | Performs an interpart update.
DoUpdate | Updates the current session
EndLocalUpdate | Ends the local update session, and clears the update mark for that session.
GetDefaultUpdateFailureAction | Gets the default action to take when an object fails to update.
GetDeleteList | Returns the global delete list
GetObjectsOnDeleteList | Returns the objects on the global delete list.
GetUpdateLock | Gets the update lock status.
LogForUpdate | Logs an object for update.
MakeUpToDate | Updates all given out-of-date features or expressions to make them up to date
RemoveFromDeleteList | Removes objects from the global delete list.
RemoveObjectsFromDeleteList | Removes objects from the global delete list.
RemoveUpdateFailureAction | Removes the update failure action for an object.
SetDefaultUpdateFailureAction | Sets the default action to take when an object fails to update.
SetPropagateDelete | Sets the propagate delete for update
SetUpdateFailureAction | Sets the update failure action for an object.
SetUpdateLock | Sets the update lock to lock and unlock updates.
StartLocalUpdate | Starts a local update session, and sets an update mark for that session.
UndelayObjectUpdate | Undelay an Object
UpdateAllIntrapartPartModulesInPart | Updates all out-of-date intrapart part modules
UpdateAllLinkedPartModulesInPart | Updates all linked part modules in the part
UpdateAllProductInterfaceInPart | Updates all out-of-date product interfaces

# Enumerations

UpdateFailureOption Enumeration | Specifies the action to take when an object fails to update.
UpdateOption Enumeration | Specifies whether a method should perform an update or not.

# Property Detail

## AssemblyConstraintsDelay

`Update.``AssemblyConstraintsDelay`

  Returns or sets the state of the assembly constraints delay flag.

  If true, then all the assembly constraints in the session will be delayed from update. If false, then updates will be applied across all parts in the session.

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

  Getter Method

  Signature `AssemblyConstraintsDelay`

  Returns: | The current state of the assembly constraints delay flag.
  Return type: | bool

  New in version NX7.5.0.

  License requirements: None.

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

  Setter Method

  Signature `AssemblyConstraintsDelay`

  Parameters: | delayed (bool) – The new state of the assembly constraints delay flag.

  New in version NX7.5.0.

  License requirements: None.

## ErrorList

`Update.``ErrorList`

  Returns the list of all the errors that the Update module has encountered since the last time that the list was cleared.

  To clear the list, use `NXOpen.Update.ClearErrorList()`.

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

  Getter Method

  Signature `ErrorList`

  Returns: |
  Return type: | `NXOpen.ErrorList`

  New in version NX3.0.0.

  License requirements: None.

## InterpartDelay

`Update.``InterpartDelay`

  Returns or sets the state of the interpart delay flag.

  If interpart delay is turned on, then updates will not be propagated beyond the work part. If off, then updates will be applied across all parts in the session.

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

  Getter Method

  Signature `InterpartDelay`

  Returns: | The current state of the interpart delay flag.
  Return type: | bool

  New in version NX3.0.0.

  License requirements: None.

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

  Setter Method

  Signature `InterpartDelay`

  Parameters: | delayed (bool) – The new state of the interpart delay flag.

  New in version NX3.0.0.

  License requirements: None.

## IntrapartPartModuleDelay

`Update.``IntrapartPartModuleDelay`

  Returns or sets the delay status for intrapart part modules delays

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

  Getter Method

  Signature `IntrapartPartModuleDelay`

  Returns: | The current state of the intra part delay flag.
  Return type: | bool

  New in version NX9.0.0.

  License requirements: None.

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

  Setter Method

  Signature `IntrapartPartModuleDelay`

  Parameters: | delayed (bool) – The new state of the interpart delay flag.

  New in version NX9.0.0.

  License requirements: None.

## ProductInterfaceDelay

`Update.``ProductInterfaceDelay`

  Returns or sets the delay status for product interface delays

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

  Getter Method

  Signature `ProductInterfaceDelay`

  Returns: | The current state of the product interface delay flag.
  Return type: | bool

  New in version NX11.0.1.

  License requirements: None.

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

  Setter Method

  Signature `ProductInterfaceDelay`

  Parameters: | delayed (bool) – The new state of the product interface delay flag.

  New in version NX11.0.1.

  License requirements: None.

# Method Detail

## AddObjectsToDeleteList

`Update.``AddObjectsToDeleteList`

  Adds objects to the global delete list.

  The objects in the global delete list will be deleted when the next update is performed. An update can be performed through the `NXOpen.Update.DoUpdate()` method.

  Note: if you are removing objects from a sketch, `NXOpen.Sketch.DeleteObjects()` should be used instead.

  Signature `AddObjectsToDeleteList(objects)`

  Parameters: | objects (list of `NXOpen.TaggedObject`) – The objects to be deleted
  Returns: | The number of errors in the update module’s

  error list. If errors occurred during the execution of this method, they will be added to that error list. To obtain a list of these errors, use `NXOpen.Update.ErrorList()`. :rtype: int

  New in version NX11.0.0.

  License requirements: None.

## AddToDeleteList

`Update.``AddToDeleteList`

  Adds objects to the global delete list.

  The objects in the global delete list will be deleted when the next update is performed. An update can be performed through the `NXOpen.Update.DoUpdate()` method.

  Note: if you are removing objects from a sketch, `NXOpen.Sketch.DeleteObjects()` should be used instead.

  Signature `AddToDeleteList(objects)`

  Parameters: | objects (list of `NXOpen.NXObject`) – The objects to be deleted
  Returns: | The number of errors in the update module’s

  error list. If errors occurred during the execution of this method, they will be added to that error list. To obtain a list of these errors, use `NXOpen.Update.ErrorList()` :rtype: int

  New in version NX3.0.0.

  Deprecated since version NX12.0.0: Use `Update.AddObjectsToDeleteList()` instead.

  License requirements: None.

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

  <summary>Adds an object to the global delete list.</summary> The objects in the global delete list will be deleted when the next update is performed. An update can be performed through the `NXOpen.Update.DoUpdate()` method.

  Note: if you are removing objects from a sketch, `NXOpen.Sketch.DeleteObjects()` should be used instead.

  Signature `AddToDeleteList(object)`

  Parameters: | object (`NXOpen.TaggedObject`) – The object to be deleted
  Returns: | The number of errors in the update module’s

  error list. If errors occurred during the execution of this method, they will be added to that error list. To obtain a list of these errors, use `NXOpen.Update.ErrorList()` :rtype: int

  New in version NX3.0.0.

  License requirements: None.

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

## ClearDeleteList

`Update.``ClearDeleteList`

  Clears the contents of the global delete list.

  Clearing the global delete list does not delete any of the objects on the list.

  Signature `ClearDeleteList()`

  New in version NX3.0.0.

  License requirements: None.

## ClearErrorList

`Update.``ClearErrorList`

  Clears the update error list.

  See `NXOpen.Update.ErrorList()` for more information about the update error list.

  Signature `ClearErrorList()`

  New in version NX3.0.0.

  License requirements: None.

## DoAssemblyConstraintsUpdate

`Update.``DoAssemblyConstraintsUpdate`

  Performs an assembly constraints update.

  This ensures that all parts containing out-of-date assembly constraints in this session are updated.

  Signature `DoAssemblyConstraintsUpdate(undoMarkId)`

  Parameters: | undoMarkId (int) – If any update error occurs, the system will roll back to this undo mark.

  New in version NX7.5.0.

  License requirements: None.

## DoAssemblyConstraintsUpdateInPart

`Update.``DoAssemblyConstraintsUpdateInPart`

  Performs an assembly constraints update.

  This ensures that the specified part containing out-of-date assembly constraints is updated.

  Signature `DoAssemblyConstraintsUpdateInPart(partTag, undoMarkId)`

  Parameters:

  - partTag (`NXOpen.Part`) –
  - undoMarkId (int) – If any update error occurs, the system will roll back to this undo mark.

  New in version NX7.5.0.

  License requirements: None.

## DoInterpartUpdate

`Update.``DoInterpartUpdate`

  Performs an interpart update.

  This ensures that all parts in the session are updated with respect to any changes on other loaded parts. Note that this update will always occur regardless of the state of the interpart delay flag. See `NXOpen.Update.InterpartDelay()`

  Signature `DoInterpartUpdate(undoMark)`

  Parameters: | undoMark (int) – If any update error occurs, the system will roll back to this undo mark.

  New in version NX3.0.0.

  License requirements: None.

## DoUpdate

`Update.``DoUpdate`

  Updates the current session

  Signature `DoUpdate(undoMark)`

  Parameters: | undoMark (int) – If any update error occurs, the system will roll back to this undo mark and throw an exception.
  Returns: | The number of errors in the update module’s error list.

  If errors occurred during update they will be added to that error list. To obtain a list of these errors, use `NXOpen.Update.ErrorList()` :rtype: int

  New in version NX3.0.0.

  License requirements: None.

## EndLocalUpdate

`Update.``EndLocalUpdate`

  Ends the local update session, and clears the update mark for that session.

  See `NXOpen.Update.StartLocalUpdate()` for details about the local update session.

  Signature `EndLocalUpdate()`

  New in version NX7.5.1.

  License requirements: None.

## GetDefaultUpdateFailureAction

`Update.``GetDefaultUpdateFailureAction`

  Gets the default action to take when an object fails to update.

  An object will execute the default update failure action if it fails to update. The default update failure action is executed on a failing object even if there is a specific update action set for that object.

  Signature `GetDefaultUpdateFailureAction()`

  Returns: | The default update failure action
  Return type: | `NXOpen.UpdateFailureOption`

  New in version NX9.0.0.

  License requirements: None.

## GetDeleteList

`Update.``GetDeleteList`

  Returns the global delete list

  Signature `GetDeleteList()`

  Returns: |
  Return type: | list of `NXOpen.NXObject`

  New in version NX3.0.0.

  Deprecated since version NX12.0.0: Use `Update.GetObjectsOnDeleteList()` instead.

  License requirements: None.

## GetObjectsOnDeleteList

`Update.``GetObjectsOnDeleteList`

  Returns the objects on the global delete list.

  Signature `GetObjectsOnDeleteList()`

  Returns: |
  Return type: | list of `NXOpen.TaggedObject`

  New in version NX11.0.0.

  License requirements: None.

## GetUpdateLock

`Update.``GetUpdateLock`

  Gets the update lock status.

  Also see `NXOpen.Update.SetUpdateLock()`

  Signature `GetUpdateLock()`

  Returns: | The lock state
  Return type: | bool

  New in version NX7.5.5.

  License requirements: None.

## LogForUpdate

`Update.``LogForUpdate`

  Logs an object for update.

  Signature `LogForUpdate(objectToUpdate)`

  Parameters: | objectToUpdate (`NXOpen.TaggedObject`) – The object to be updated

  New in version NX7.5.3.

  License requirements: None.

## MakeUpToDate

`Update.``MakeUpToDate`

  Updates all given out-of-date features or expressions to make them up to date

  Signature `MakeUpToDate(objects, undoMarkId)`

  Parameters:

  - objects (list of `NXOpen.NXObject`) – The objects to be made up to date
  - undoMarkId (int) – If any update error occurs, the system will roll back to this undo mark.

  New in version NX9.0.0.

  License requirements: None.

## RemoveFromDeleteList

`Update.``RemoveFromDeleteList`

  Removes objects from the global delete list.

  Note: if the object is not in the delete list, it will be ignored. An exception will not be raised.

  Signature `RemoveFromDeleteList(objects)`

  Parameters: | objects (list of `NXOpen.NXObject`) – The objects to be removed from the delete list

  New in version NX3.0.0.

  Deprecated since version NX12.0.0: Use `Update.RemoveObjectsFromDeleteList()` instead.

  License requirements: None.

## RemoveObjectsFromDeleteList

`Update.``RemoveObjectsFromDeleteList`

  Removes objects from the global delete list.

  Note: if an object is not in the delete list, it will be ignored. An exception will not be raised.

  Signature `RemoveObjectsFromDeleteList(objects)`

  Parameters: | objects (list of `NXOpen.TaggedObject`) – The objects to be removed from the delete list

  New in version NX11.0.0.

  License requirements: None.

## RemoveUpdateFailureAction

`Update.``RemoveUpdateFailureAction`

  Removes the update failure action for an object.

  Signature `RemoveUpdateFailureAction(object)`

  Parameters: | object (`NXOpen.TaggedObject`) – The object that fails to update

  New in version NX7.5.0.

  License requirements: None.

## SetDefaultUpdateFailureAction

`Update.``SetDefaultUpdateFailureAction`

  Sets the default action to take when an object fails to update.

  An object will execute the default update failure action if it fails to update. The default update failure action is executed on a failing object even if there is a specific update action set for that object.

  Signature `SetDefaultUpdateFailureAction(failureAction)`

  Parameters: | failureAction (`NXOpen.UpdateFailureOption`) – The default update failure action

  New in version NX9.0.0.

  License requirements: None.

## SetPropagateDelete

`Update.``SetPropagateDelete`

  Sets the propagate delete for update

  Signature `SetPropagateDelete(propagateToDelete)`

  Parameters: | propagateToDelete (bool) –

  New in version NX12.0.0.

  License requirements: None.

## SetUpdateFailureAction

`Update.``SetUpdateFailureAction`

  Sets the update failure action for an object.

  An object will execute this update failure action if it fails to update. If there is a default update failure action defined, that action overrides any specific update failure action set for an object.

  Signature `SetUpdateFailureAction(object, failureAction)`

  Parameters:

  - object (`NXOpen.TaggedObject`) – The object that fails to update
  - failureAction (`NXOpen.UpdateFailureOption`) – The update failure action

  New in version NX7.5.0.

  License requirements: None.

## SetUpdateLock

`Update.``SetUpdateLock`

  Sets the update lock to lock and unlock updates.

  Locking updates will lock model updates until updates are unlocked. Note that updates should be locked with utmost care as operations can produce undesired results or possibly result in unexpected failures when they are performed when updates are locked.

  If you do choose to lock updates then you have to ensure that the update lock state prior to locking update is restored after your operation. See `NXOpen.Update.GetUpdateLock()` to get the lock status. Additionally, a call to `NXOpen.Update.DoUpdate()` has to be made after restoring the lock status to ensure that entities added to the update list after update was locked are updated.

  Signature `SetUpdateLock(lock)`

  Parameters: | lock (bool) – The lock state

  New in version NX7.5.5.

  License requirements: None.

## StartLocalUpdate

`Update.``StartLocalUpdate`

  Starts a local update session, and sets an update mark for that session.

  This ensures that only entities added into update list since the mark setting are updated when the next update is performed before the mark is cleared. To perform update,use `NXOpen.Update.DoUpdate()`. To clear the mark, use `NXOpen.Update.EndLocalUpdate()`.

  Note:

  > 1. Any entities updated while the mark was in place will not be updated during the next update even if

  they depend on entities on the newly restored list.
    1. Local update may not be nested.i.e.if a local update process is started and not yet ended, you cannot start another one.

  Signature `StartLocalUpdate()`

  New in version NX7.5.1.

  License requirements: None.

## UndelayObjectUpdate

`Update.``UndelayObjectUpdate`

  Undelay an Object

  Signature `UndelayObjectUpdate(objectToUpdate)`

  Parameters: | objectToUpdate (`NXOpen.TaggedObject`) – The object to be undelayed

  New in version NX7.5.3.

  License requirements: None.

## UpdateAllIntrapartPartModulesInPart

`Update.``UpdateAllIntrapartPartModulesInPart`

  Updates all out-of-date intrapart part modules

  Signature `UpdateAllIntrapartPartModulesInPart(partTag, undoMarkId)`

  Parameters:

  - partTag (`NXOpen.Part`) –
  - undoMarkId (int) – If any update error occurs, the system will roll back to this undo mark.

  New in version NX9.0.0.

  License requirements: None.

## UpdateAllLinkedPartModulesInPart

`Update.``UpdateAllLinkedPartModulesInPart`

  Updates all linked part modules in the part

  Signature `UpdateAllLinkedPartModulesInPart(partTag, undoMarkId)`

  Parameters:

  - partTag (`NXOpen.Part`) –
  - undoMarkId (int) – If any update error occurs, the system will roll back to this undo mark.

  New in version NX10.0.0.

  License requirements: usr_defined_features (“USER DEFINED FEATURES”)

## UpdateAllProductInterfaceInPart

`Update.``UpdateAllProductInterfaceInPart`

  Updates all out-of-date product interfaces

  Signature `UpdateAllProductInterfaceInPart(partTag, undoMarkId)`

  Parameters:

  - partTag (`NXOpen.Part`) –
  - undoMarkId (int) – If any update error occurs, the system will roll back to this undo mark.

  New in version NX11.0.1.

  License requirements: None.