ComponentConstraint Class

class NXOpen.Positioning.ComponentConstraint

Bases: NXOpen.Positioning.Constraint

Constraint for use in positioning assembly objects in NX.

New in version NX5.0.1.

Properties

Property Description
ArrangementSpecific Returns or sets the arrangement specific state of this NXOpen.Positioning.ComponentConstraint in the NXOpen.Positioning.ComponentPositioner.PrimaryArrangement`.
Automatic Returns or sets the flag marking the constraint as an automatic constraint.
ConstraintAlignment Returns or sets the alignment behavior for the constraint.
ConstraintType Returns or sets the constraint type.
Expression Returns the expression used for constraint.
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
Persistent Returns or sets the persistent state of the constraint.
Prototype Returns the prototype of this object if it is an occurrence.
SplinePointsType Returns or sets the type of the spline.
Suppressed Returns or sets the suppression state for the constraint.
Tag Returns the Tag for this object.

Methods

Method Description
CreateConstraintReference Adds geometry to a constraint and sets the movable object to be constrained.
DeleteAllAttributesByType Deletes all attributes of a specific type.
DeleteAttributeByTypeAndTitle Deletes an attribute by type and title.
DeleteConstraintReference Removes a NXOpen.Positioning.ConstraintReference from the constraint.
DeleteUserAttribute Deletes the first attribute encountered with the given Type, Title.
DeleteUserAttributes Deletes the attributes encountered with the given Type with option to update or not.
EditConstraintReference Adds geometry to a constraint and sets the movable object to be constrained, replacing the properties of an existing reference of the constraint.
FindObject Finds the NXOpen.NXObject with the given identifier as recorded in a journal.
FlipAlignment Reverses the constraint alignment if this is possible.
GenerateConversionReport Returns a textual conversion report this constraint from when it was converted from a Mating Constraint to an Assembly Constraint.
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.
GetConstraintStatus Returns the solver status of a constraint.
GetDirectionToFixed Get the NXOpen.Positioning.ComponentConstraintDirectionToFixed value of the NXOpen.Positioning.ComponentConstraint given a component and an arrangement.
GetDisplayedConstraint Gets the NXOpen.Positioning.DisplayedConstraint that is in the same part as that of the constraint.
GetInherited Get whether this NXOpen.Positioning.ComponentConstraint is an inherited constraint.
GetIntegerAttribute Gets an integer attribute by title.
GetIntegerUserAttribute Gets an integer attribute by Title and array Index.
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.
GetReferences Gets all the :py:class:`NXOpen.Positioning.ConstraintReference`s for the constraint.
GetSharedSuppressed Get the shared suppression state of this NXOpen.Positioning.ComponentConstraint used across all arrangements where the constraint is not arrangement specific.
GetSpecificInArrangement Get the arrangement specific state of this NXOpen.Positioning.ComponentConstraint in the specified NXOpen.Assemblies.Arrangement.
GetStringAttribute Gets a string attribute value by title.
GetStringUserAttribute Gets a string attribute by Title and array Index.
GetSuppressedInArrangement Get the suppression state of this NXOpen.Positioning.ComponentConstraint in the specified NXOpen.Assemblies.Arrangement.
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, of the given type.
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.
GetUserAttributesAsStrings Gets all the attributes that have been set on the given object.
HasUserAttribute 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.
Print Prints a representation of this object to the system log file.
RememberOnComponent Remembers the constraint in the prototype part of a referenced component for reuse in other occurrences of the part.
ReverseDirection Reverses the constraint direction.
SetAlignmentHint Set a hint as to which alignment should be used by the solver for this constraint.
SetAttribute Creates or modifies an integer attribute.
SetBooleanUserAttribute Creates or modifies a boolean attribute with the option to update or not.
SetExpression The expression used for constraint - only for distance or angle
SetName Sets the custom name of the object.
SetReferenceAttribute Creates or modifies a string attribute which uses a reference string.
SetSharedSuppressed Set the shared suppression state of this NXOpen.Positioning.ComponentConstraint used across all arrangements where the constraint is not arrangement specific.
SetSpecificInArrangement Set the arrangement specific state of this NXOpen.Positioning.ComponentConstraint in the specified NXOpen.Assemblies.Arrangement.
SetSuppressedInArrangement Set the suppression state of this NXOpen.Positioning.ComponentConstraint in the specified NXOpen.Assemblies.Arrangement.
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

ComponentConstraintDirectionToFixed Enumeration Specifies how a constraint affects the positioning of a component.

Property Detail

ArrangementSpecific

ComponentConstraint.ArrangementSpecific

Returns or sets the arrangement specific state of this NXOpen.Positioning.ComponentConstraint in the NXOpen.Positioning.ComponentPositioner.PrimaryArrangement`.

Constraints can never be arrangement specific in piece parts.

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

Getter Method

Signature ArrangementSpecific()

Returns:The arrangement specific state
Return type:bool

New in version NX6.0.0.

License requirements: assemblies (“ASSEMBLIES MODULE”)

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

Setter Method

Signature ArrangementSpecific(arrangementSpecific)

Parameters:arrangementSpecific (bool) – The arrangement specific state

New in version NX6.0.0.

License requirements: assemblies (“ASSEMBLIES MODULE”)

IsOccurrence

ComponentConstraint.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

ComponentConstraint.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

ComponentConstraint.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

ComponentConstraint.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

ComponentConstraint.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

ComponentConstraint.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

FindObject

ComponentConstraint.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.

GetDirectionToFixed

ComponentConstraint.GetDirectionToFixed

Get the NXOpen.Positioning.ComponentConstraintDirectionToFixed value of the NXOpen.Positioning.ComponentConstraint given a component and an arrangement.

This value specifies how a constraint affects the positioning of a component. If the arrangement is null, the “direction to fixed” value will be evaluated based on the default arrangement.

Signature GetDirectionToFixed(component, arrangement)

Parameters:
Returns:

The NXOpen.Positioning.ComponentConstraintDirectionToFixed value.

Return type:

NXOpen.Positioning.ComponentConstraintDirectionToFixed

New in version NX9.0.0.

License requirements: assemblies (“ASSEMBLIES MODULE”)

GetInherited

ComponentConstraint.GetInherited

Get whether this NXOpen.Positioning.ComponentConstraint is an inherited constraint.

An inherited constraint is created by the system to support Positioning Overrides.

Signature GetInherited()

Returns:The inherited state of this NXOpen.Positioning.ComponentConstraint
Return type:bool

New in version NX9.0.0.

License requirements: assemblies (“ASSEMBLIES MODULE”)

GetSharedSuppressed

ComponentConstraint.GetSharedSuppressed

Get the shared suppression state of this NXOpen.Positioning.ComponentConstraint used across all arrangements where the constraint is not arrangement specific.

Signature GetSharedSuppressed()

Returns:The suppression state.
Return type:bool

New in version NX10.0.0.

License requirements: assemblies (“ASSEMBLIES MODULE”)

GetSpecificInArrangement

ComponentConstraint.GetSpecificInArrangement

Get the arrangement specific state of this NXOpen.Positioning.ComponentConstraint in the specified NXOpen.Assemblies.Arrangement.

Signature GetSpecificInArrangement(arrangement)

Parameters:arrangement (NXOpen.Assemblies.Arrangement) – The NXOpen.Assemblies.Arrangement in which the arrangement specific state is being enquired.
Returns:The arrangement specific state.
Return type:bool

New in version NX6.0.0.

License requirements: assemblies (“ASSEMBLIES MODULE”)

GetSuppressedInArrangement

ComponentConstraint.GetSuppressedInArrangement

Get the suppression state of this NXOpen.Positioning.ComponentConstraint in the specified NXOpen.Assemblies.Arrangement.

If the constraint is not arrangement specific in this arrangement then the shared suppression state, used across all arrangements where the constraint is not arrangement specific, is used.

Signature GetSuppressedInArrangement(arrangement)

Parameters:arrangement (NXOpen.Assemblies.Arrangement) – The NXOpen.Assemblies.Arrangement in which the suppression state is being enquired.
Returns:The suppression state.
Return type:bool

New in version NX6.0.0.

License requirements: assemblies (“ASSEMBLIES MODULE”)

Print

ComponentConstraint.Print

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

Signature Print()

New in version NX3.0.0.

License requirements: None.

RememberOnComponent

ComponentConstraint.RememberOnComponent

Remembers the constraint in the prototype part of a referenced component for reuse in other occurrences of the part.

Fix and Bond constraints are never remembered. If the constraint does not reference geometry in the component, it is not remembered.

Signature RememberOnComponent(component)

Parameters:component (NXOpen.Assemblies.Component) – The NXOpen.Assemblies.Component on which the constraint is remembered

New in version NX5.0.1.

License requirements: assemblies (“ASSEMBLIES MODULE”)

SetName

ComponentConstraint.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.

SetSharedSuppressed

ComponentConstraint.SetSharedSuppressed

Set the shared suppression state of this NXOpen.Positioning.ComponentConstraint used across all arrangements where the constraint is not arrangement specific.

Signature SetSharedSuppressed(suppressed)

Parameters:suppressed (bool) – The suppression state.

New in version NX10.0.0.

License requirements: assemblies (“ASSEMBLIES MODULE”)

SetSpecificInArrangement

ComponentConstraint.SetSpecificInArrangement

Set the arrangement specific state of this NXOpen.Positioning.ComponentConstraint in the specified NXOpen.Assemblies.Arrangement.

Signature SetSpecificInArrangement(arrangement, arrangementSpecific)

Parameters:

New in version NX6.0.0.

License requirements: assemblies (“ASSEMBLIES MODULE”)

SetSuppressedInArrangement

ComponentConstraint.SetSuppressedInArrangement

Set the suppression state of this NXOpen.Positioning.ComponentConstraint in the specified NXOpen.Assemblies.Arrangement.

If the constraint is not arrangement specific in this arrangement then the shared suppression state, used across all arrangements where the constraint is not arrangement specific, is set.

Signature SetSuppressedInArrangement(arrangement, suppressed)

Parameters:

New in version NX6.0.0.

License requirements: assemblies (“ASSEMBLIES MODULE”)