NXObject Class

class NXOpen.NXObject

Bases: NXOpen.TaggedObject, NXOpen.INXObject

A base class providing low-level services for most NXOpen classes.

For more information on NX rules for Names and Attributes, see the Properties section of the Gateway Help.

This is an abstract class, and cannot be instantiated.

New in version NX3.0.0.

Properties

Property Description
IsOccurrence Returns whether this object is an occurrence or not.
JournalIdentifier Returns the identifier that would be recorded in a journal for this object.
Name Returns the custom name of the object.
OwningComponent Returns the owning component, if this object is an occurrence.
OwningPart Returns the owning part of this object
Prototype Returns the prototype of this object if it is an occurrence.
Tag Returns the Tag for this object.

Methods

Method Description
CreateAttributeIterator Create an attribute iterator @return A new attribute iterator object
DeleteAllAttributesByType Deletes all attributes of a specific type.
DeleteAttributeByTypeAndTitle Deletes an attribute by type and title.
DeleteUserAttribute Deletes the first attribute encountered with the given Type, Title.
DeleteUserAttributes Deletes the attributes on the object, if any, that satisfy the given iterator
FindObject Finds the NXOpen.NXObject with the given identifier as recorded in a journal.
GetAttributeTitlesByType Gets all the attribute titles of a specific type.
GetBooleanUserAttribute Gets a boolean attribute by Title and array Index.
GetComputationalTimeUserAttribute Gets a time attribute by Title and array Index.
GetIntegerAttribute Gets an integer attribute by title.
GetIntegerUserAttribute Gets an integer attribute by Title and array Index.
GetNextUserAttribute Gets the next attribute encountered on the object, if any, that satisfies the given iterator.
GetRealAttribute Gets a real attribute by title.
GetRealUserAttribute Gets a real attribute by Title and array Index.
GetReferenceAttribute Gets the reference string (not the calculated value) of a string attribute that uses a reference string.
GetStringAttribute Gets a string attribute value by title.
GetStringUserAttribute Gets a string attribute by Title and array Index.
GetTimeAttribute Gets a time attribute by title.
GetTimeUserAttribute Gets a time attribute by Title and array Index.
GetUserAttribute Gets the first attribute encountered on the object, if any, with a given Title, Type and array Index.
GetUserAttributeAsString Gets the first attribute encountered on the object, if any, with a given title, type and array index.
GetUserAttributeCount Gets the count of set attributes on the object, if any, that satisfy the given iterator.
GetUserAttributeLock Determine the lock of the given attribute.
GetUserAttributeSize Gets the size of the first attribute encountered on the object, if any, with a given Title and Type.
GetUserAttributeSourceObjects Returns an array of objects from which this object presents attributes.
GetUserAttributes Gets all the attributes that have been set on the given object, if any, that satisfy the given iterator.
GetUserAttributesAsStrings Gets all the attributes that have been set on the given object.
HasUserAttribute Determines if an attribute exists on the object, that satisfies the given iterator @return
Print Prints a representation of this object to the system log file.
SetAttribute Creates or modifies an integer attribute.
SetBooleanUserAttribute Creates or modifies a boolean attribute with the option to update or not.
SetName Sets the custom name of the object.
SetReferenceAttribute Creates or modifies a string attribute which uses a reference string.
SetTimeAttribute Creates or modifies a time attribute.
SetTimeUserAttribute Creates or modifies a time attribute with the option to update or not.
SetUserAttribute Creates or modifies an attribute with the option to update or not.
SetUserAttributeLock Lock or unlock the given attribute.

Enumerations

NXObjectAttributeType Enumeration Specifies attribute type.
NXObjectDateAndTimeFormat Enumeration Specifies the format of the date and time attribute.

Structs

NXObjectAttributeInformation_Struct Struct Contains attribute information.
NXObjectComputationalTime_Struct Struct Holds the computational time value of a time attribute.

Property Detail

IsOccurrence

NXObject.IsOccurrence

Returns whether this object is an occurrence or not.

-------------------------------------

Getter Method

Signature IsOccurrence()

Returns:This object is an occurrence
Return type:bool

New in version NX3.0.0.

License requirements: None.

JournalIdentifier

NXObject.JournalIdentifier

Returns the identifier that would be recorded in a journal for this object.

This may not be the same across different releases of the software.

-------------------------------------

Getter Method

Signature JournalIdentifier()

Returns:
Return type:str

New in version NX3.0.0.

License requirements: None.

Name

NXObject.Name

Returns the custom name of the object.

-------------------------------------

Getter Method

Signature Name()

Returns:
Return type:str

New in version NX3.0.0.

License requirements: None.

OwningComponent

NXObject.OwningComponent

Returns the owning component, if this object is an occurrence.

-------------------------------------

Getter Method

Signature OwningComponent()

Returns:
Return type:NXOpen.Assemblies.Component

New in version NX3.0.0.

License requirements: None.

OwningPart

NXObject.OwningPart

Returns the owning part of this object

-------------------------------------

Getter Method

Signature OwningPart()

Returns:The owning part of this object or null if it does not have an owner
Return type:NXOpen.BasePart

New in version NX3.0.0.

License requirements: None.

Prototype

NXObject.Prototype

Returns the prototype of this object if it is an occurrence.

-------------------------------------

Getter Method

Signature Prototype()

Returns:The prototype of this object or null if this object is not an occurrence
Return type:NXOpen.INXObject

New in version NX3.0.0.

License requirements: None.

Method Detail

CreateAttributeIterator

NXObject.CreateAttributeIterator

Create an attribute iterator

Signature CreateAttributeIterator()

Returns:A new attribute iterator object
Return type:NXOpen.AttributeIterator

New in version NX11.0.0.

License requirements: None.

DeleteAllAttributesByType

NXObject.DeleteAllAttributesByType

Overloaded method DeleteAllAttributesByType

  • DeleteAllAttributesByType(type)
  • DeleteAllAttributesByType(type, option)

-------------------------------------

Deletes all attributes of a specific type. This method performs an immediate update except when the object is a NXOpen.Features.Feature. If a candidate attribute is an array attribute, this method will delete all the array elements. NOTE: If the input specifies reference type, then this function will delete string type non-array attributes that have a reference value. The reference type is used only to single out string type non-array attributes that contain a reference value. The use of reference type in this function is deprecated. Please use string type instead.

Signature DeleteAllAttributesByType(type)

Parameters:type (NXOpen.NXObjectAttributeType) –

New in version NX3.0.0.

Deprecated since version NX8.0.0: Use DeleteUserAttributes() instead.

License requirements: None.

-------------------------------------

Deletes all attributes of a specific type with the option to update or not. If a candidate attribute is an array attribute, this method will delete all the array elements. NOTE: If the input specifies reference type, then this function will delete string type non-array attributes that have a reference value. The reference type is used only to single out string type non-array attributes that contain a reference value. The use of reference type in this function is deprecated. Please use string type instead.

Signature DeleteAllAttributesByType(type, option)

Parameters:

New in version NX5.0.1.

Deprecated since version NX8.0.0: Use DeleteUserAttributes() instead.

License requirements: None.

-------------------------------------

DeleteAttributeByTypeAndTitle

NXObject.DeleteAttributeByTypeAndTitle

Overloaded method DeleteAttributeByTypeAndTitle

  • DeleteAttributeByTypeAndTitle(type, title)
  • DeleteAttributeByTypeAndTitle(type, title, option)

-------------------------------------

Deletes an attribute by type and title. This method performs an immediate update except when the object is a NXOpen.Features.Feature. If a candidate attribute is an array attribute, this method will delete all the array elements. NOTE: If the input specifies reference type, then this function will delete string type attributes that have a reference value. The reference type is used only to single out string type attributes that contain a reference value. The use of reference type in this function is discouraged.

Signature DeleteAttributeByTypeAndTitle(type, title)

Parameters:

New in version NX3.0.0.

Deprecated since version NX8.0.0: Use DeleteUserAttribute() instead.

License requirements: None.

-------------------------------------

Deletes an attribute by type and title with the option to update or not. If a candidate attribute is an array attribute, this method will delete all the array elements. NOTE: If the input specifies reference type, then this function will delete string type attributes that have a reference value. The reference type is used only to single out string type attributes that contain a reference value. The use of reference type in this function is discouraged.

Signature DeleteAttributeByTypeAndTitle(type, title, option)

Parameters:

New in version NX5.0.1.

Deprecated since version NX8.0.0: Use DeleteUserAttribute() instead.

License requirements: None.

-------------------------------------

DeleteUserAttribute

NXObject.DeleteUserAttribute

Deletes the first attribute encountered with the given Type, Title.

If a candidate attribute is not an array attribute, the DeleteEntireArray input is ignored, If a candidate attribute is an array attribute and DeleteEntireArray input is ‘false’, then the last element of the array is deleted. If a candidate attribute is an array attribute and DeleteEntireArray input is ‘true’, then the entire array is deleted. NOTE: This method does not support the use of NXOpen.NXObjectAttributeType.Reference.

Signature DeleteUserAttribute(type, title, deleteEntireArray, option)

Parameters:

New in version NX8.0.0.

License requirements: None.

DeleteUserAttributes

NXObject.DeleteUserAttributes

Overloaded method DeleteUserAttributes

  • DeleteUserAttributes(iterator, option)
  • DeleteUserAttributes(type, option)

-------------------------------------

Deletes the attributes on the object, if any, that satisfy the given iterator

Signature DeleteUserAttributes(iterator, option)

Parameters:

New in version NX8.0.0.

License requirements: None.

-------------------------------------

Deletes the attributes encountered with the given Type with option to update or not. NOTE: This method does not support the use of NXOpen.NXObjectAttributeType.Reference.

Signature DeleteUserAttributes(type, option)

Parameters:

New in version NX8.0.0.

License requirements: None.

-------------------------------------

FindObject

NXObject.FindObject

Finds the NXOpen.NXObject with the given identifier as recorded in a journal.

An object may not return the same value as its JournalIdentifier in different versions of the software. However newer versions of the software should find the same object when FindObject is passed older versions of its journal identifier. In general, this method should not be used in handwritten code and exists to support record and playback of journals.

An exception will be thrown if no object can be found with the given journal identifier.

Signature FindObject(journalIdentifier)

Parameters:journalIdentifier (str) – Journal identifier of the object
Returns:
Return type:NXOpen.INXObject

New in version NX3.0.0.

License requirements: None.

GetAttributeTitlesByType

NXObject.GetAttributeTitlesByType

Gets all the attribute titles of a specific type.

Only Title and Type are set in the returned struct. No values are returned. Array attributes are supported. The Title returned is the array title, with no index appended. Only one title is returned per array. This function does not return the titles of unset attributes. NOTE: If the input specifies reference type, then this function will get string type attributes that have a reference value. The reference type is used only to single out string type attributes that contain a reference value. The use of reference type in this function is deprecated. Please use string type instead.

Signature GetAttributeTitlesByType(type)

Parameters:type (NXOpen.NXObjectAttributeType) –
Returns:
Return type:list of NXOpen.NXObjectAttributeInformation_Struct

New in version NX3.0.0.

Deprecated since version NX8.0.0: Use GetUserAttributes() instead.

License requirements: None.

GetBooleanUserAttribute

NXObject.GetBooleanUserAttribute

Gets a boolean attribute by Title and array Index.

This function will not look for unset attributes. If the attribute to be found is not an array, set the Index to -1, otherwise set it to the desired index. The first element of an array has Index 0 (zero). To get all the array elements of an array, please use NXOpen.NXObject.GetUserAttributes().

Signature GetBooleanUserAttribute(title, index)

Parameters:
  • title (str) –
  • index (int) –
Returns:

Return type:

bool

New in version NX8.0.0.

License requirements: None.

GetComputationalTimeUserAttribute

NXObject.GetComputationalTimeUserAttribute

Gets a time attribute by Title and array Index.

The time value returned will be in the current time zone of the machine running the program. If the attribute to be found is not an array, set the Index to -1, otherwise set it to the desired index. The first element of an array has Index 0 (zero). To get all the array elements of an array, please use NXOpen.NXObject.GetUserAttributes().

Signature GetComputationalTimeUserAttribute(title, index)

Parameters:
  • title (str) –
  • index (int) –
Returns:

The time in the local time zone

Return type:

NXOpen.NXObjectComputationalTime_Struct

New in version NX8.5.2.

License requirements: None.

GetIntegerAttribute

NXObject.GetIntegerAttribute

Gets an integer attribute by title.

This method does not support array attributes.

Signature GetIntegerAttribute(title)

Parameters:title (str) –
Returns:
Return type:int

New in version NX3.0.0.

Deprecated since version NX8.0.0: Use GetUserAttribute() instead.

License requirements: None.

GetIntegerUserAttribute

NXObject.GetIntegerUserAttribute

Gets an integer attribute by Title and array Index.

This function will not look for unset attributes. If the attribute to be found is not an array, set the Index to -1, otherwise set it to the desired index. The first element of an array has Index 0 (zero). To get all the array elements of an array, please use NXOpen.NXObject.GetUserAttributes().

Signature GetIntegerUserAttribute(title, index)

Parameters:
  • title (str) –
  • index (int) –
Returns:

Return type:

int

New in version NX8.0.0.

License requirements: None.

GetNextUserAttribute

NXObject.GetNextUserAttribute

Gets the next attribute encountered on the object, if any, that satisfies the given iterator.

Signature GetNextUserAttribute(iterator)

Parameters:iterator (NXOpen.AttributeIterator) – NXOpen.AttributeIterator
Returns:a tuple
Return type:A tuple consisting of (foundAttribute, info). foundAttribute is a bool. info is a NXOpen.NXObjectAttributeInformation_Struct.

New in version NX11.0.0.

License requirements: None.

GetRealAttribute

NXObject.GetRealAttribute

Gets a real attribute by title.

This method does not support array attributes.

Signature GetRealAttribute(title)

Parameters:title (str) –
Returns:
Return type:float

New in version NX3.0.0.

Deprecated since version NX8.0.0: Use GetUserAttribute() instead.

License requirements: None.

GetRealUserAttribute

NXObject.GetRealUserAttribute

Gets a real attribute by Title and array Index.

This function will not look for unset attributes. If the attribute to be found is not an array, set the Index to -1, otherwise set it to the desired index. The first element of an array has Index 0 (zero). To get all the array elements of an array, please use NXOpen.NXObject.GetUserAttributes().

Signature GetRealUserAttribute(title, index)

Parameters:
  • title (str) –
  • index (int) –
Returns:

Return type:

float

New in version NX8.0.0.

License requirements: None.

GetReferenceAttribute

NXObject.GetReferenceAttribute

Gets the reference string (not the calculated value) of a string attribute that uses a reference string.

Get the attribute by title. For the calculated value, please use NXOpen.NXObject.GetUserAttribute() This method does not support array attributes.

Signature GetReferenceAttribute(title)

Parameters:title (str) –
Returns:
Return type:str

New in version NX3.0.0.

Deprecated since version NX8.0.0: Use GetUserAttribute() instead.

License requirements: None.

GetStringAttribute

NXObject.GetStringAttribute

Gets a string attribute value by title.

For string attributes that use reference strings, this function returns the calculated value, not the reference string. This method does not support array attributes.

Signature GetStringAttribute(title)

Parameters:title (str) –
Returns:
Return type:str

New in version NX3.0.0.

Deprecated since version NX8.0.0: Use GetUserAttribute() instead.

License requirements: None.

GetStringUserAttribute

NXObject.GetStringUserAttribute

Gets a string attribute by Title and array Index.

For reference type string attributes, the calculated StringValue is returned. This function will not look for unset attributes. If the attribute to be found is not an array, set the Index to -1, otherwise set it to the desired index. The first element of an array has Index 0 (zero). To get all the array elements of an array, please use NXOpen.NXObject.GetUserAttributes().

Signature GetStringUserAttribute(title, index)

Parameters:
  • title (str) –
  • index (int) –
Returns:

Return type:

str

New in version NX8.0.0.

License requirements: None.

GetTimeAttribute

NXObject.GetTimeAttribute

Gets a time attribute by title.

The time returned will be in the current time zone of the machine running the program. This method does not support array attributes. This method is deprecated.

Signature GetTimeAttribute(format, title)

Parameters:
Returns:

Return type:

str

New in version NX3.0.0.

Deprecated since version NX8.0.0: Use GetUserAttribute() instead.

License requirements: None.

GetTimeUserAttribute

NXObject.GetTimeUserAttribute

Gets a time attribute by Title and array Index.

The date format set by the Customer Defaults is used. The time value returned is in the current time zone of the machine running the program. This function will not look for unset attributes. If the attribute to be found is not an array, set the Index to -1, otherwise set it to the desired index. The first element of an array has Index 0 (zero). To get all the array elements of an array, please use NXOpen.NXObject.GetUserAttributes(). NOTE: The returned string must be deleted by the caller

Signature GetTimeUserAttribute(title, index)

Parameters:
  • title (str) –
  • index (int) –
Returns:

Return type:

str

New in version NX8.0.0.

License requirements: None.

GetUserAttribute

NXObject.GetUserAttribute

Overloaded method GetUserAttribute

  • GetUserAttribute(title, type, index)
  • GetUserAttribute(title, includeUnset, addStringValues, type)

-------------------------------------

Gets the first attribute encountered on the object, if any, with a given Title, Type and array Index. This function will return data for unset attributes. For non-string attribute types, the string-converted value is returned as well for convenience. If the attribute to be found is not an array, set the Index to -1, otherwise set it to the desired index. If an unset attribute is read, then the index returned has no meaning. The first element of an array has Index 0 (zero). To get all the array elements of an array, please use NXOpen.NXObject.GetUserAttributes(). The date format set by the Customer Defaults is used for attributes of type time. NOTE: This method does not support the use of NXOpen.NXObjectAttributeType.Reference. Instead, use NXOpen.NXObjectAttributeType.String. For reference type string attributes, both the ReferenceValue and the calculated StringValue are returned.

Signature GetUserAttribute(title, type, index)

Parameters:
Returns:

Return type:

NXOpen.NXObjectAttributeInformation_Struct

New in version NX8.0.0.

License requirements: None.

-------------------------------------

Gets the first attribute (or attribute array) encountered on the object, if any, with a given Title and Type. This function will optionally return data for unset attributes. For non-string attribute types, the string-converted value is returned as well for convenience. If the attribute cannot be found, but a template is found, then a single struct is returned with information from the template. If neither an attribute nor a template can be found, then no struct is returned (None)). If a non-array attribute is found, a single struct is returned with information from that attribute. If an array attribute is found, then an array of structs is returned with information from each of the array elements of the attribute. Array elements are returned in order of increasing indices. The first element of an array has Index 0 (zero). The date format set by the Customer Defaults is used for attributes of type time. NOTE: This method does not support the use of NXOpen.NXObjectAttributeType.Reference. Instead, use NXOpen.NXObjectAttributeType.String. For reference type string attributes, both the ReferenceValue and the calculated StringValue are returned.

Signature GetUserAttribute(title, includeUnset, addStringValues, type)

Parameters:
Returns:

Return type:

list of NXOpen.NXObjectAttributeInformation_Struct

New in version NX10.0.0.

Deprecated since version NX11.0.0: Use GetUserAttribute() instead.

License requirements: None.

-------------------------------------

GetUserAttributeAsString

NXObject.GetUserAttributeAsString

Gets the first attribute encountered on the object, if any, with a given title, type and array index.

The value of the attribute is converted to and returned as a string. If the attribute is not an array, the Index is ignored (if this is known beforehand, we recommend setting the Index to -1 to save time). The first element of an array has Index 0 (zero). To get all the array elements of an array, please use NXOpen.NXObject.GetUserAttributes(). The date format set by the Customer Defaults is used for attributes of type time. NOTE: This method does not support the use of NXOpen.NXObjectAttributeType.Reference. Instead, use NXOpen.NXObjectAttributeType.String. For reference type string attributes, the calculated StringValue is returned.

Signature GetUserAttributeAsString(title, type, index)

Parameters:
Returns:

Return type:

str

New in version NX8.0.0.

License requirements: None.

GetUserAttributeCount

NXObject.GetUserAttributeCount

Overloaded method GetUserAttributeCount

  • GetUserAttributeCount(iterator)
  • GetUserAttributeCount(iterator, countArrayAsOneAttribute)
  • GetUserAttributeCount(type)
  • GetUserAttributeCount(type, includeUnset, countArrayAsOneAttribute)

-------------------------------------

Gets the count of set attributes on the object, if any, that satisfy the given iterator. Array elements are counted individually.

Signature GetUserAttributeCount(iterator)

Parameters:iterator (NXOpen.AttributeIterator) – NXOpen.AttributeIterator
Returns:
Return type:int

New in version NX11.0.0.

License requirements: None.

-------------------------------------

Gets the count of set attributes on the object, if any, that satisfy the given iterator. Array elements are optionally counted individually.

Signature GetUserAttributeCount(iterator, countArrayAsOneAttribute)

Parameters:
Returns:

Return type:

int

New in version NX11.0.0.

License requirements: None.

-------------------------------------

Gets the count of set attributes on the object, if any, of the given type. Will not include unset attributes. Array elements are counted individually.

Signature GetUserAttributeCount(type)

Parameters:type (NXOpen.NXObjectAttributeType) –
Returns:
Return type:int

New in version NX10.0.0.

License requirements: None.

-------------------------------------

Gets the count of attributes on the object, if any, of the given type. Includes option to include unset attributes (i.e. to count attribute templates with no associated attributes). Includes option to count arrays as one attribute or to count array elements individually. NOTE: This method does not support the use of NXOpen.NXObjectAttributeType.Reference. Instead, use NXOpen.NXObjectAttributeType.String.

Signature GetUserAttributeCount(type, includeUnset, countArrayAsOneAttribute)

Parameters:
Returns:

Return type:

int

New in version NX10.0.0.

License requirements: None.

-------------------------------------

GetUserAttributeLock

NXObject.GetUserAttributeLock

Determine the lock of the given attribute.

For array attributes, the Title should be set to the array title, without the appended index. Individual array elements cannot be separately locked

Signature GetUserAttributeLock(title, type)

Parameters:
Returns:

Return type:

bool

New in version NX8.0.0.

License requirements: None.

GetUserAttributeSize

NXObject.GetUserAttributeSize

Gets the size of the first attribute encountered on the object, if any, with a given Title and Type.

For unset attributes (with or without templates), the returned size will be 0. For non-array set attributes, the returned size will be 1. For array attributes, the returned size will be the count of array elements that have been set. NOTE: This method does not support the use of NXOpen.NXObjectAttributeType.Reference. Instead, use NXOpen.NXObjectAttributeType.String.

Signature GetUserAttributeSize(title, type)

Parameters:
Returns:

Return type:

int

New in version NX10.0.0.

License requirements: None.

GetUserAttributeSourceObjects

NXObject.GetUserAttributeSourceObjects

Returns an array of objects from which this object presents attributes.

The order of the array is in inheritance order so earlier objects may be able to override objects at higher indices in the array allowing for the rules set up for the particular attributes involved. If this object itself can own attributes it will also be in the array.

Signature GetUserAttributeSourceObjects()

Returns:
Return type:list of NXOpen.NXObject

New in version NX8.5.0.

License requirements: None.

GetUserAttributes

NXObject.GetUserAttributes

Overloaded method GetUserAttributes

  • GetUserAttributes(iterator)
  • GetUserAttributes()
  • GetUserAttributes(includeUnset)
  • GetUserAttributes(includeUnset, addStringValues)

-------------------------------------

Gets all the attributes that have been set on the given object, if any, that satisfy the given iterator. The results will not include information from associated attribute templates of unset attributes. The elements of array attributes are returned individually in order of increasing indices. The returned Title of an array element is the array title (without index). The Index data member holds the index. The date format set by the Customer Defaults is used. Reference type attributes are returned as being of type NXOpen.NXObjectAttributeType.String, and both the ReferenceValue and the calculated StringValue are returned.

Signature GetUserAttributes(iterator)

Parameters:iterator (NXOpen.AttributeIterator) – NXOpen.AttributeIterator
Returns:
Return type:list of NXOpen.NXObjectAttributeInformation_Struct

New in version NX11.0.0.

License requirements: None.

-------------------------------------

Gets all the attributes that have been set on the given object. The results will not include information from associated attribute templates of unset attributes. The elements of array attributes are returned individually in order of increasing indices. The returned Title of an array element is the array title (without index). The Index data member holds the index. The date format set by the Customer Defaults is used. Reference type attributes are returned as being of type NXOpen.NXObjectAttributeType.String, and both the ReferenceValue and the calculated StringValue are returned.

Signature GetUserAttributes()

Returns:
Return type:list of NXOpen.NXObjectAttributeInformation_Struct

New in version NX8.0.0.

License requirements: None.

-------------------------------------

Gets all the attributes of the given object. Includes option to return information also from associated attribute templates of unset attributes. The values returned for unset attributes are the default values from the templates. The elements of array attributes are returned individually in order of increasing indices. The returned Title of an array element is the array title (without index). The Index data member holds the index. The date format set by the Customer Defaults is used. Reference type attributes are returnes as being of type NXOpen.NXObjectAttributeType.String, and both the ReferenceValue and the calculated StringValue are returned.

Signature GetUserAttributes(includeUnset)

Parameters:includeUnset (bool) –
Returns:
Return type:list of NXOpen.NXObjectAttributeInformation_Struct

New in version NX8.0.0.

License requirements: None.

-------------------------------------

Gets all the attributes of the given object. Includes option to return information also from associated attribute templates of unset attributes. The values returned for unset attributes are the default values from the templates. Includes an option to return the value not only in the natural type, but also converted to a string (effective only for non-string attributes). The elements of array attributes are returned individually in order of increasing indices. The returned Title of an array element is the array title (without index). The Index data member holds the index. The date format set by the Customer Defaults is used. Reference type attributes are returned as being of type NXOpen.NXObjectAttributeType.String, and both the ReferenceValue and the calculated StringValue are returned.

Signature GetUserAttributes(includeUnset, addStringValues)

Parameters:
  • includeUnset (bool) –
  • addStringValues (bool) –
Returns:

Return type:

list of NXOpen.NXObjectAttributeInformation_Struct

New in version NX8.5.0.

Deprecated since version NX11.0.0: Use GetUserAttributes() instead.

License requirements: None.

-------------------------------------

GetUserAttributesAsStrings

NXObject.GetUserAttributesAsStrings

Gets all the attributes that have been set on the given object.

The values are returned as strings. The elements of array attributes are returned individually in order of increasing indices. The returned Title of an array element is the array title (without index). The Index data member holds the index. Reference type attributes return the calculated StringValue. The date format set by the Customer Defaults is used.

Signature GetUserAttributesAsStrings()

Returns:
Return type:list of str

New in version NX8.0.0.

Deprecated since version NX8.5.0: Use GetUserAttributes() instead.

License requirements: None.

HasUserAttribute

NXObject.HasUserAttribute

Overloaded method HasUserAttribute

  • HasUserAttribute(iterator)
  • HasUserAttribute(title, type, index)

-------------------------------------

Determines if an attribute exists on the object, that satisfies the given iterator

Signature HasUserAttribute(iterator)

Parameters:iterator (NXOpen.AttributeIterator) – NXOpen.AttributeIterator
Returns:
Return type:bool

New in version NX11.0.0.

License requirements: None.

-------------------------------------

Determines if an attribute with the given Title, Type and array Index is present on the object Unset attributes will not be detected by this function, as its purpose is to test for the actual presence of the attribute on the object. If the attribute to be found is not an array, set the index to -1, otherwise set it to the desired index. The first element of an array has Index 0 (zero). NOTE: This method does not support the use of NXOpen.NXObjectAttributeType.Reference. Instead, use NXOpen.NXObjectAttributeType.String.

Signature HasUserAttribute(title, type, index)

Parameters:
Returns:

Return type:

bool

New in version NX8.0.0.

License requirements: None.

-------------------------------------

Print

NXObject.Print

Prints a representation of this object to the system log file.

Signature Print()

New in version NX3.0.0.

License requirements: None.

SetAttribute

NXObject.SetAttribute

Overloaded method SetAttribute

  • SetAttribute(title, value)
  • SetAttribute(title, value, option)
  • SetAttribute(title, value)
  • SetAttribute(title, value, option)
  • SetAttribute(title, value)
  • SetAttribute(title, value, option)
  • SetAttribute(title)
  • SetAttribute(title, option)

-------------------------------------

Creates or modifies an integer attribute. This method performs an immediate update except when the object is a NXOpen.Features.Feature. This method does not support array attributes. NOTE: This method should not be used to edit a read-only object such as a Mirrored PMI object. If it is, the changes will be overridden when the part is updated.

Signature SetAttribute(title, value)

Parameters:
  • title (str) –
  • value (int) –

New in version NX3.0.0.

Deprecated since version NX8.0.0: Use SetUserAttribute() instead.

License requirements: None.

-------------------------------------

Creates or modifies an integer attribute with the option to update or not. This method does not support array attributes. NOTE: This method should not be used to edit a read-only object such as a Mirrored PMI object. If it is, the changes will be overridden when the part is updated.

Signature SetAttribute(title, value, option)

Parameters:

New in version NX5.0.1.

Deprecated since version NX8.0.0: Use SetUserAttribute() instead.

License requirements: None.

-------------------------------------

Creates or modifies a real attribute. This method performs an immediate update except when the object is a NXOpen.Features.Feature. This method does not support array attributes. NOTE: This method should not be used to edit a read-only object such as a Mirrored PMI object. If it is, the changes will be overridden when the part is updated.

Signature SetAttribute(title, value)

Parameters:
  • title (str) –
  • value (float) –

New in version NX3.0.0.

Deprecated since version NX8.0.0: Use SetUserAttribute() instead.

License requirements: None.

-------------------------------------

Creates or modifies a real attribute with the option to update or not. This method does not support array attributes. NOTE: This method should not be used to edit a read-only object such as a Mirrored PMI object. If it is, the changes will be overridden when the part is updated.

Signature SetAttribute(title, value, option)

Parameters:

New in version NX5.0.1.

Deprecated since version NX8.0.0: Use SetUserAttribute() instead.

License requirements: None.

-------------------------------------

Creates or modifies a string attribute. This method performs an immediate update except when the object is a NXOpen.Features.Feature. This method does not support array attributes. NOTE: This method should not be used to edit a read-only object such as a Mirrored PMI object. If it is, the changes will be overridden when the part is updated.

Signature SetAttribute(title, value)

Parameters:
  • title (str) –
  • value (str) –

New in version NX3.0.0.

Deprecated since version NX8.0.0: Use SetUserAttribute() instead.

License requirements: None.

-------------------------------------

Creates or modifies a string attribute with the option to update or not. This method does not support array attributes. NOTE: This method should not be used to edit a read-only object such as a Mirrored PMI object. If it is, the changes will be overridden when the part is updated.

Signature SetAttribute(title, value, option)

Parameters:

New in version NX5.0.1.

Deprecated since version NX8.0.0: Use SetUserAttribute() instead.

License requirements: None.

-------------------------------------

Creates or modifies a null attribute which is an attribute with a title and no value. This method performs an immediate update except when the object is a NXOpen.Features.Feature. This method does not support array attributes. NOTE: This method should not be used to edit a read-only object such as a Mirrored PMI object. If it is, the changes will be overridden when the part is updated.

Signature SetAttribute(title)

Parameters:title (str) –

New in version NX3.0.0.

Deprecated since version NX8.0.0: Use SetUserAttribute() instead.

License requirements: None.

-------------------------------------

Creates or modifies a null attribute with the option to update or not. This method does not support array attributes. NOTE: This method should not be used to edit a read-only object such as a Mirrored PMI object. If it is, the changes will be overridden when the part is updated.

Signature SetAttribute(title, option)

Parameters:

New in version NX5.0.1.

Deprecated since version NX8.0.0: Use SetUserAttribute() instead.

License requirements: None.

-------------------------------------

SetBooleanUserAttribute

NXObject.SetBooleanUserAttribute

Creates or modifies a boolean attribute with the option to update or not.

To set a non-array attribute, set the index = -1. Arrays can be extended only one element at a time. NOTE: This method should not be used to edit a read-only object such as a Mirrored PMI object. If it is, the changes will be overridden when the part is updated.

Signature SetBooleanUserAttribute(title, index, value, option)

Parameters:

New in version NX8.0.0.

License requirements: None.

SetName

NXObject.SetName

Sets the custom name of the object.

NOTE: This method should not be used to edit a read-only object such as a Mirrored PMI object. If it is, the changes will be overridden when the part is updated.

Signature SetName(name)

Parameters:name (str) –

New in version NX3.0.0.

License requirements: None.

SetReferenceAttribute

NXObject.SetReferenceAttribute

Overloaded method SetReferenceAttribute

  • SetReferenceAttribute(title, value)
  • SetReferenceAttribute(title, value, option)

-------------------------------------

Creates or modifies a string attribute which uses a reference string. This method performs an immediate update except when the object is a NXOpen.Features.Feature. NOTE: The input value must be a valid reference string. This method does not support array attributes. NOTE: This method should not be used to edit a read-only object such as a Mirrored PMI object. If it is, the changes will be overridden when the part is updated.

Signature SetReferenceAttribute(title, value)

Parameters:
  • title (str) –
  • value (str) –

New in version NX3.0.0.

Deprecated since version NX8.0.0: Use SetUserAttribute() instead.

License requirements: None.

-------------------------------------

Creates or modifies a string attribute which uses a reference string, with the option to update or not. NOTE: The input value must be a valid reference string. This method does not support array attributes. NOTE: This method should not be used to edit a read-only object such as a Mirrored PMI object. If it is, the changes will be overridden when the part is updated.

Signature SetReferenceAttribute(title, value, option)

Parameters:

New in version NX5.0.1.

Deprecated since version NX8.0.0: Use SetUserAttribute() instead.

License requirements: None.

-------------------------------------

SetTimeAttribute

NXObject.SetTimeAttribute

Overloaded method SetTimeAttribute

  • SetTimeAttribute(title, value)
  • SetTimeAttribute(title, value, option)

-------------------------------------

Creates or modifies a time attribute. This method performs an immediate update except when the object is a NXOpen.Features.Feature. The time value is assumed to be in the current time zone of the machine running the program. NX will store the value in UTC. This method does not support array attributes. NOTE: This method should not be used to edit a read-only object such as a Mirrored PMI object. If it is, the changes will be overridden when the part is updated.

Signature SetTimeAttribute(title, value)

Parameters:

New in version NX3.0.0.

Deprecated since version NX8.0.0: Use SetUserAttribute() instead.

License requirements: None.

-------------------------------------

Creates or modifies a time attribute with the option to update or not. The time value is assumed to be in the current time zone of the machine running the program. NX will store the value in UTC. This method does not support array attributes. NOTE: This method should not be used to edit a read-only object such as a Mirrored PMI object. If it is, the changes will be overridden when the part is updated.

Signature SetTimeAttribute(title, value, option)

Parameters:

New in version NX5.0.1.

Deprecated since version NX8.0.0: Use SetUserAttribute() instead.

License requirements: None.

-------------------------------------

SetTimeUserAttribute

NXObject.SetTimeUserAttribute

Overloaded method SetTimeUserAttribute

  • SetTimeUserAttribute(title, index, value, option)
  • SetTimeUserAttribute(title, index, value, option)

-------------------------------------

Creates or modifies a time attribute with the option to update or not. The time value is assumed to be in the current time zone of the machine running the program. NX will store the value in UTC. To set a non-array attribute, set the index = -1. Arrays can be extended only one element at a time. NOTE: This method should not be used to edit a read-only object such as a Mirrored PMI object. If it is, the changes will be overridden when the part is updated. NOTE: The valid range for attributes of type date is from 01-Jan-1970 to 31-Dec-2105

Signature SetTimeUserAttribute(title, index, value, option)

Parameters:

New in version NX8.0.0.

License requirements: None.

-------------------------------------

Creates or modifies a time attribute with the option to update or not. The time value is assumed to be in the current time zone of the machine running the program. NX will store the value in UTC. To set a non-array attribute, set the index = -1. Arrays can be extended only one element at a time. NOTE: This method should not be used to edit a read-only object such as a Mirrored PMI object. If it is, the changes will be overridden when the part is updated.

Signature SetTimeUserAttribute(title, index, value, option)

Parameters:

New in version NX8.0.0.

License requirements: None.

-------------------------------------

SetUserAttribute

NXObject.SetUserAttribute

Overloaded method SetUserAttribute

  • SetUserAttribute(info, option)
  • SetUserAttribute(title, index, value, option)
  • SetUserAttribute(title, index, value, option)
  • SetUserAttribute(title, index, value, option)
  • SetUserAttribute(title, index, option)

-------------------------------------

Creates or modifies an attribute with the option to update or not. NOTE: This method does not support the use of NXOpen.NXObjectAttributeType.Reference. Instead, set the type to NXOpen.NXObjectAttributeType.String and specify a ReferenceValue. NOTE: To set an NXOpen.NXObjectAttributeType.Time attribute, either a formatted string or a computational value may be used. If both are set (the string is not None and the computational value is not (0,0)), then the computational value will take precedence. The time value in either case is in the current time zone of the machine running the program.

The following data members of the Info structure are ignored by this method: Alias Inherited Required Unset Locked OwnedBySystem PdmBased

The following data members of an attribute cannot be edited once the attribute is set: Type Title TitleAlias Array ArrayElementIndex The dimensionality of the Unit specification (cannot change from mm to microA, but from mm to cm is fine)

The following data of an attribute can be set if and only if the attribute is not associated with a template. It cannot be modified once set. Array Category Transient

NOTE: This method should not be used to edit a read-only object such as a Mirrored PMI object. If it is, the changes will be overridden when the part is updated. NOTE: The valid range for attributes of type date is from 01-Jan-1970 to 31-Dec-2105

Signature SetUserAttribute(info, option)

Parameters:

New in version NX8.0.0.

License requirements: None.

-------------------------------------

Creates or modifies an integer attribute with the option to update or not. To set a non-array attribute, set the index = -1. Arrays can be extended only one element at a time. NOTE: This method should not be used to edit a read-only object such as a Mirrored PMI object. If it is, the changes will be overridden when the part is updated.

Signature SetUserAttribute(title, index, value, option)

Parameters:

New in version NX8.0.0.

License requirements: None.

-------------------------------------

Creates or modifies a real attribute with the option to update or not. To set a non-array attribute, set the index = -1. Arrays can be extended only one element at a time. NOTE: This method should not be used to edit a read-only object such as a Mirrored PMI object. If it is, the changes will be overridden when the part is updated.

Signature SetUserAttribute(title, index, value, option)

Parameters:

New in version NX8.0.0.

License requirements: None.

-------------------------------------

Creates or modifies a string attribute with the option to update or not. To set a non-array attribute, set the index = -1. Arrays can be extended only one element at a time. NOTE: This method should not be used to edit a read-only object such as a Mirrored PMI object. If it is, the changes will be overridden when the part is updated.

Signature SetUserAttribute(title, index, value, option)

Parameters:

New in version NX8.0.0.

License requirements: None.

-------------------------------------

Creates or modifies a null attribute with the option to update or not. To set a non-array attribute, set the index = -1. Arrays can be extended only one element at a time. NOTE: This method should not be used to edit a read-only object such as a Mirrored PMI object. If it is, the changes will be overridden when the part is updated.

Signature SetUserAttribute(title, index, option)

Parameters:

New in version NX8.0.0.

License requirements: None.

-------------------------------------

SetUserAttributeLock

NXObject.SetUserAttributeLock

Lock or unlock the given attribute.

For array attributes, the Title should be set to the array title, without the appended index. Individual array elements cannot be separately locked. NOTE: Attributes that are reserved (OwnedBySystem), cannot be unlocked. NOTE: This method should not be used to edit a read-only object such as a Mirrored PMI object. If it is, the changes will be overridden when the part is updated.

Signature SetUserAttributeLock(title, type, lock)

Parameters:

New in version NX8.0.0.

License requirements: None.