AttributeIterator Class

class NXOpen.AttributeIterator

Bases: NXOpen.TransientObject

This class is used to iterate over the user attributes of an object, with options to restrict or extend such searches

New in version NX11.0.0.

Methods

Method Description
Dispose Delete the iterator
Reset Rewind the iterator and return all its constraints to their default values.
Rewind Rewind the iterator.
SetIncludeAllCategories Do not restrict searches to attributes with a previously given category.
SetIncludeAlsoUnset Widen (or cancel the widening of) searches to attributes that have not been set, but for which the object has associated templates.
SetIncludeOnlyArrays Restricts searches to array attributes.
SetIncludeOnlyCategory Restrict searches to attributes with the given category.
SetIncludeOnlyTitle Restrict searches to attributes with the given title.
SetIncludeOnlyType Restrict searches to attributes with the given type.
SetIncludeOnlyUnset Restricts (or cancel the restriction of) searches to attributes that have not been set, but for which the object has associated templates.

Method Detail

Dispose

AttributeIterator.Dispose

Delete the iterator

Signature Dispose()

New in version NX11.0.0.

License requirements: None.

Reset

AttributeIterator.Reset

Rewind the iterator and return all its constraints to their default values.

This allows the iterator to be safely reused.

Signature Reset()

New in version NX11.0.0.

License requirements: None.

Rewind

AttributeIterator.Rewind

Rewind the iterator.

This allows the iterator to be reused with the same constraints.

Signature Rewind()

New in version NX11.0.0.

License requirements: None.

SetIncludeAllCategories

AttributeIterator.SetIncludeAllCategories

Do not restrict searches to attributes with a previously given category.

Note: If this function will allow the iterator to return attributes with any or no category. It can be use to cancel a previous restriction to, for example, attributes with no category.

Signature SetIncludeAllCategories()

New in version NX11.0.0.

License requirements: None.

SetIncludeAlsoUnset

AttributeIterator.SetIncludeAlsoUnset

Widen (or cancel the widening of) searches to attributes that have not been set, but for which the object has associated templates.

Default: Unset attributes (not being there) are not included. Note: ‘unset’ attributes are really attribute templates that the object has access to, but the object has no corresponding attributes.

Signature SetIncludeAlsoUnset(includeAlsoUnset)

Parameters:includeAlsoUnset (bool) –

New in version NX11.0.0.

License requirements: None.

SetIncludeOnlyArrays

AttributeIterator.SetIncludeOnlyArrays

Restricts searches to array attributes.

NOTE: Array attributes with no or just one element are included unless otherwise excluded. . Default: no constraint.

Signature SetIncludeOnlyArrays(includeOnlyArrays)

Parameters:includeOnlyArrays (bool) –

New in version NX11.0.0.

License requirements: None.

SetIncludeOnlyCategory

AttributeIterator.SetIncludeOnlyCategory

Restrict searches to attributes with the given category.

Note: If this function is called with a NULL or empty category, then the search is restricted to attributes that have no assigned category To cancel this restriction, use SetIncludeAllCategories. . Default: no constraint.

Signature SetIncludeOnlyCategory(category)

Parameters:category (str) – The desired category of the returned attributes

New in version NX11.0.0.

License requirements: None.

SetIncludeOnlyTitle

AttributeIterator.SetIncludeOnlyTitle

Restrict searches to attributes with the given title.

Note: If this function is called with a NULL or empty title, then iterator will no longer be restricted to a given title. . Default: no constraint.

Signature SetIncludeOnlyTitle(title)

Parameters:title (str) – The desired title of the returned attributes

New in version NX11.0.0.

License requirements: None.

SetIncludeOnlyType

AttributeIterator.SetIncludeOnlyType

Restrict searches to attributes with the given type.

Default: no constraint.

Signature SetIncludeOnlyType(type)

Parameters:type (NXOpen.NXObjectAttributeType) – The desired type of the returned attributes (if not NXOpen.NXObjectAttributeType.Any)

New in version NX11.0.0.

License requirements: None.

SetIncludeOnlyUnset

AttributeIterator.SetIncludeOnlyUnset

Restricts (or cancel the restriction of) searches to attributes that have not been set, but for which the object has associated templates.

Default: no constraint.

Signature SetIncludeOnlyUnset(includeOnlyUnset)

Parameters:includeOnlyUnset (bool) –

New in version NX11.0.0.

License requirements: None.