ConstraintReference Class¶
-
class
NXOpen.Positioning.
ConstraintReference
¶ Bases:
NXOpen.NXObject
ConstraintReference for use in positioning objects in NX.
A ConstraintReference is used by a Constraint to determine the movable object to be positioned by the constraint and the geometry used to define the constraint.
To create an instance of this class, use
NXOpen.Positioning.Constraint.CreateConstraintReference()
.New in version NX4.0.0.
Properties¶
Property | Description |
---|---|
ConstraintReferenceHalfSpace | Returns or sets the half_space value for the constraint reference. |
GeometryDirectionReversed | Returns or sets whether the direction is reversed with respect to the direction of the geometry. |
HelpPoint | Returns or sets the help point of the constraint reference. |
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. |
Order | Returns the order of the constraint reference within its constraint. |
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. |
SolverGeometryType | Returns the geometry type of the constraint reference used during a solve. |
Tag | Returns the Tag for this object. |
UsePortRotateFlag | Returns or sets the flag forcing the use of the rotation vector of the referenced NXOpen.Routing.Port object instead of the alignment vector when solving the constraint system. |
Methods¶
Method | Description |
---|---|
CreateAttributeIterator | Create an attribute iterator |
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. |
GetGeometry | Returns the geometry of the constraint reference. |
GetHasPerpendicularVector | Get the flag indicating whether the constraint reference is one that maintains a direction perpendicular to the primary geometry. |
GetIntegerAttribute | Gets an integer attribute by title. |
GetIntegerUserAttribute | Gets an integer attribute by Title and array Index. |
GetMovableObject | Returns the movable object of the constraint reference. |
GetNextUserAttribute | Gets the next attribute encountered on the object, if any, that satisfies the given iterator. |
GetPdmReferenceAttributeValue | Gets the value of PDM Reference attribute for given object. |
GetPrototypeGeometry | Returns the prototype geometry of the constraint reference. |
GetPrototypePerpendicularVector | Get the value of the perpendicular vector, which will be (0,0,0) for most constraints apart from NXOpen.Positioning.ConstraintType.AlignLock . |
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. |
GetUsePortRotate | Get the flag forcing the use of the rotation vector of the referenced NXOpen.Routing.Port object instead of the alignment vector when solving the constraint system. |
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. |
GetUsesGeometryAxis | Returns if the constraint reference should use the axis of the geometry (for example a cylindrical face) rather than the surface |
HasUserAttribute | Determines if an attribute exists on the object, that satisfies the given iterator |
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. |
SetFixHint | Set a hint to the solver to fix the movable object associated with this constraint reference. |
SetFixHintForUpdate | Set a hint to the solver to fix the movable object associated with this constraint reference. |
SetName | Sets the custom name of the object. |
SetPdmReferenceAttribute | Sets the value of PDM Reference attribute on the object. |
SetPrototypePerpendicularVector | Set the value of the perpendicular vector. |
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¶
ConstraintReferenceConstraintOrder Enumeration | Specifies the order of the constraint reference used in a NXOpen.Positioning.Constraint . |
ConstraintReferenceGeometryType Enumeration | Specifies the type of the geometry used in a NXOpen.Positioning.ConstraintReference . |
ConstraintReferenceHalfSpace Enumeration | Specifies the half space value of one geometry used in a distance constraint. |
Property Detail¶
ConstraintReferenceHalfSpace¶
-
ConstraintReference.
ConstraintReferenceHalfSpace
¶ Returns or sets the half_space value for the constraint reference.
This is only used for distance constraints.
-------------------------------------
Getter Method
Signature
ConstraintReferenceHalfSpace
Returns: Half space for constraint reference Return type: NXOpen.Positioning.ConstraintReferenceHalfSpace
New in version NX5.0.1.
License requirements: assemblies (“ASSEMBLIES MODULE”)
-------------------------------------
Setter Method
Signature
ConstraintReferenceHalfSpace
Parameters: halfSpace ( NXOpen.Positioning.ConstraintReferenceHalfSpace
) – Half space for constraint referenceNew in version NX5.0.1.
License requirements: assemblies (“ASSEMBLIES MODULE”)
GeometryDirectionReversed¶
-
ConstraintReference.
GeometryDirectionReversed
¶ Returns or sets whether the direction is reversed with respect to the direction of the geometry.
This property is only used if the underlying geometry can have an associated direction.
-------------------------------------
Getter Method
Signature
GeometryDirectionReversed
Returns: Whether the direction is reversed with respect to the geometry Return type: bool New in version NX12.0.0.
License requirements: assemblies (“ASSEMBLIES MODULE”)
-------------------------------------
Setter Method
Signature
GeometryDirectionReversed
Parameters: geometryDirectionReversed (bool) – Whether the direction is reversed with respect to the geometry New in version NX12.0.0.
License requirements: assemblies (“ASSEMBLIES MODULE”)
HelpPoint¶
-
ConstraintReference.
HelpPoint
¶ Returns or sets the help point of the constraint reference.
-------------------------------------
Getter Method
Signature
HelpPoint
Returns: Coordinates of point in part of constraint Return type: NXOpen.Point3d
New in version NX4.0.0.
License requirements: assemblies (“ASSEMBLIES MODULE”)
-------------------------------------
Setter Method
Signature
HelpPoint
Parameters: helpPoint ( NXOpen.Point3d
) – Coordinates of point in part of constraintNew in version NX4.0.0.
License requirements: assemblies (“ASSEMBLIES MODULE”)
IsOccurrence¶
-
ConstraintReference.
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¶
-
ConstraintReference.
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¶
-
ConstraintReference.
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.
Order¶
-
ConstraintReference.
Order
¶ Returns the order of the constraint reference within its constraint.
Note that this order is not associated with the geometry or with the alignment of the constraint. It is based on the idea that the constraint has a direction from “outside” to “inside”. It does not affect the result of a solve.
-------------------------------------
Getter Method
Signature
Order
Returns: The order Return type: NXOpen.Positioning.ConstraintReferenceConstraintOrder
New in version NX5.0.0.
License requirements: assemblies (“ASSEMBLIES MODULE”)
OwningComponent¶
-
ConstraintReference.
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¶
-
ConstraintReference.
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¶
-
ConstraintReference.
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.
SolverGeometryType¶
-
ConstraintReference.
SolverGeometryType
¶ Returns the geometry type of the constraint reference used during a solve.
-------------------------------------
Getter Method
Signature
SolverGeometryType
Returns: The geometry type Return type: NXOpen.Positioning.ConstraintReferenceGeometryType
New in version NX5.0.0.
License requirements: assemblies (“ASSEMBLIES MODULE”)
UsePortRotateFlag¶
-
ConstraintReference.
UsePortRotateFlag
¶ Returns or sets the flag forcing the use of the rotation vector of the referenced
NXOpen.Routing.Port
object instead of the alignment vector when solving the constraint system.Only effective when the referenced geometry is a
NXOpen.Routing.Port
object.-------------------------------------
Getter Method
Signature
UsePortRotateFlag
Returns: Return type: bool New in version NX5.0.1.
License requirements: assemblies (“ASSEMBLIES MODULE”)
-------------------------------------
Setter Method
Signature
UsePortRotateFlag
Parameters: useRotate (bool) – New in version NX5.0.1.
License requirements: assemblies (“ASSEMBLIES MODULE”)
Method Detail¶
FindObject¶
-
ConstraintReference.
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.
GetGeometry¶
-
ConstraintReference.
GetGeometry
¶ Returns the geometry of the constraint reference.
This is the geometry used in any
NXOpen.Positioning.Constraint
using this constraint reference.Signature
GetGeometry()
Returns: The geometry referenced by the constraint Return type: NXOpen.NXObject
New in version NX4.0.0.
License requirements: assemblies (“ASSEMBLIES MODULE”)
GetHasPerpendicularVector¶
-
ConstraintReference.
GetHasPerpendicularVector
¶ Get the flag indicating whether the constraint reference is one that maintains a direction perpendicular to the primary geometry.
This is only applicable to
NXOpen.Positioning.ConstraintType
NXOpen.Positioning.ConstraintType.AlignLock
.Signature
GetHasPerpendicularVector()
Returns: Whether the constraint has a perpendicular vector Return type: bool New in version NX9.0.0.
License requirements: assemblies (“ASSEMBLIES MODULE”)
GetMovableObject¶
-
ConstraintReference.
GetMovableObject
¶ Returns the movable object of the constraint reference.
The movable object determines the object to be positioned by any
NXOpen.Positioning.Constraint
using this constraint reference.Signature
GetMovableObject()
Returns: The object positioned by the constraint Return type: NXOpen.NXObject
New in version NX4.0.0.
License requirements: assemblies (“ASSEMBLIES MODULE”)
GetPrototypeGeometry¶
-
ConstraintReference.
GetPrototypeGeometry
¶ Returns the prototype geometry of the constraint reference.
This is never an occurrence.
Signature
GetPrototypeGeometry()
Returns: The prototype geometry referenced by the constraint Return type: NXOpen.NXObject
New in version NX9.0.0.
License requirements: assemblies (“ASSEMBLIES MODULE”)
GetPrototypePerpendicularVector¶
-
ConstraintReference.
GetPrototypePerpendicularVector
¶ Get the value of the perpendicular vector, which will be (0,0,0) for most constraints apart from
NXOpen.Positioning.ConstraintType.AlignLock
.Signature
GetPrototypePerpendicularVector()
Returns: The value of the perpendicular vector Return type: NXOpen.Vector3d
New in version NX9.0.0.
License requirements: assemblies (“ASSEMBLIES MODULE”)
GetUsePortRotate¶
-
ConstraintReference.
GetUsePortRotate
¶ Get the flag forcing the use of the rotation vector of the referenced
NXOpen.Routing.Port
object instead of the alignment vector when solving the constraint system.Only effective when the referenced geometry is a
NXOpen.Routing.Port
object.Signature
GetUsePortRotate()
Returns: Return type: bool New in version NX4.0.0.
License requirements: assemblies (“ASSEMBLIES MODULE”)
GetUsesGeometryAxis¶
-
ConstraintReference.
GetUsesGeometryAxis
¶ Returns if the constraint reference should use the axis of the geometry (for example a cylindrical face) rather than the surface
Signature
GetUsesGeometryAxis()
Returns: If this reference is using the axis of the geometry Return type: bool New in version NX4.0.0.
License requirements: assemblies (“ASSEMBLIES MODULE”)
Print¶
-
ConstraintReference.
Print
¶ Prints a representation of this object to the system log file.
Signature
Print()
New in version NX3.0.0.
License requirements: None.
SetFixHint¶
-
ConstraintReference.
SetFixHint
¶ Set a hint to the solver to fix the movable object associated with this constraint reference.
The hint is unset when “set” is false.
The hint can only have an effect when the constraint owning this constraint reference has been explicitly added to a
NXOpen.Positioning.Network
.The hint is forgotten after an update.
Signature
SetFixHint(set)
Parameters: set (bool) – Set or unset the hint New in version NX4.0.0.
License requirements: assemblies (“ASSEMBLIES MODULE”)
SetFixHintForUpdate¶
-
ConstraintReference.
SetFixHintForUpdate
¶ Set a hint to the solver to fix the movable object associated with this constraint reference.
The hint is unset when “set” is false.
The hint is forgotten after an update.
Ensures that the constraint that owns this reference will solve during the next call to
NXOpen.Update.DoUpdate()
.Signature
SetFixHintForUpdate(set)
Parameters: set (bool) – Set or unset the hint New in version NX4.0.0.
License requirements: assemblies (“ASSEMBLIES MODULE”)
SetName¶
-
ConstraintReference.
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.
SetPrototypePerpendicularVector¶
-
ConstraintReference.
SetPrototypePerpendicularVector
¶ Set the value of the perpendicular vector.
The value must be a unit vector given in the coordinates of the part containing the referenced geometry.
The perpendicular vector must be set to (0,0,0) for most constraints apart from
NXOpen.Positioning.ConstraintType.AlignLock
which must have a value. An error is raised if this is not the case.Whenever the constraint is solved, the value of the perpendicular vector may be modified, to ensure that the vector is perpendicular to the referenced geometry.
Signature
SetPrototypePerpendicularVector(perpendicularVector)
Parameters: perpendicularVector ( NXOpen.Vector3d
) – The value of the perpendicular vectorNew in version NX9.0.0.
License requirements: assemblies (“ASSEMBLIES MODULE”)