ComponentDefinitionCollection Class

class NXOpen.Layout2d.ComponentDefinitionCollection

Bases: object

Represents a collection of NXOpen.Layout2d.ComponentDefinition objects.

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

New in version NX10.0.0.

Methods

Method Description
Delete Deletes definition
FindObject Finds the NXOpen.Layout2d.ComponentDefinition with the given sid.
Rename Renames definition
SetAutomaticPreview Sets the automatic preview mode of definition with the given path
Update Updates definition with the given path
UpdateImage Updates definition preview

Method Detail

Delete

ComponentDefinitionCollection.Delete

Deletes definition

Signature Delete(location, definitionPath)

Parameters:

New in version NX11.0.0.

License requirements: nx_layout (“NX Layout”)

FindObject

ComponentDefinitionCollection.FindObject

Finds the NXOpen.Layout2d.ComponentDefinition with the given sid.

An exception will be thrown if no object can be found with the given sid. This method can only be used to find Local definitions

Signature FindObject(sid)

Parameters:sid (str) – The sid of the definition to find
Returns:
Return type:NXOpen.Layout2d.ComponentDefinition

New in version NX11.0.0.

License requirements: nx_layout (“NX Layout”)

Rename

ComponentDefinitionCollection.Rename

Renames definition

Signature Rename(location, definitionPath, newName)

Parameters:

New in version NX11.0.0.

License requirements: nx_layout (“NX Layout”)

SetAutomaticPreview

ComponentDefinitionCollection.SetAutomaticPreview

Sets the automatic preview mode of definition with the given path

Signature SetAutomaticPreview(location, definitionPath, isAutomatic)

Parameters:

New in version NX11.0.0.

License requirements: nx_layout (“NX Layout”)

Update

ComponentDefinitionCollection.Update

Updates definition with the given path

Signature Update(location, definitionPath)

Parameters:

New in version NX11.0.0.

License requirements: nx_layout (“NX Layout”)

UpdateImage

ComponentDefinitionCollection.UpdateImage

Updates definition preview

Signature UpdateImage(location, definitionPath, imagePath)

Parameters:
  • location (NXOpen.Layout2d.Layout2dDefinitionLocation) – Location of the definition to update image
  • definitionPath (str) – Path of the definition to update image
  • imagePath (str) – Path of the image file used to update definition preview

New in version NX11.0.0.

License requirements: nx_layout (“NX Layout”)