NX Open C++ Reference Guide
|
Constraint for use in positioning objects in NX. More...
Public Types | |
enum | Alignment { AlignmentInferAlign, AlignmentCoAlign, AlignmentContraAlign } |
Specifies alignment of directed geometries used in a constraint. More... | |
enum | SolverStatus { SolverStatusNewlyCreated, SolverStatusSuppressed, SolverStatusOutOfDate, SolverStatusOverConstrained, SolverStatusNotConsistentDims, SolverStatusNotConsistentOther, SolverStatusNotConsistentUnknown, SolverStatusBetweenFixed, SolverStatusNotSolved, SolverStatusSolved, SolverStatusCannotSolve, SolverStatusDelayed, SolverStatusIgnoredInArrangement, SolverStatusInternallyInconsistent, SolverStatusUnloadedGeometry, SolverStatusPendingConvertedMc } |
Specifies the status of a constraint. More... | |
enum | SplineType { SplineTypeByPoles, SplineTypeByPoints, SplineTypeInvalid } |
Specifies how the spline points define the shape of the spline. More... | |
enum | Type { TypeUndefined, TypeTouch, TypeConcentric, TypeFix, TypeDistance, TypeParallel, TypePerpendicular, TypeCenter12, TypeCenter22, TypeAngle, TypeFit, TypeBond, TypeOrientAngle, TypeSplineData, TypeSplineLength, TypeLinearPattern, TypeCircularPattern, TypeLinear2dPattern, TypeRadiantPattern } |
Specifies the type of a constraint. More... | |
Public Member Functions | |
bool | Automatic () |
Returns the flag marking the constraint as an "automatic" constraint. | |
NXOpen::Positioning::Constraint::Alignment | ConstraintAlignment () |
Returns the alignment behavior for the constraint. | |
NXOpen::Positioning::Constraint::Type | ConstraintType () |
Returns the constraint type. | |
NXOpen::Positioning::ConstraintReference * | CreateConstraintReference (NXOpen::NXObject *movableObject, NXOpen::NXObject *geometry, bool usesAxis, bool isIndirect) |
Adds geometry to a constraint and sets the movable object to be constrained. | |
NXOpen::Positioning::ConstraintReference * | CreateConstraintReference (NXOpen::NXObject *movableObject, NXOpen::NXObject *geometry, bool usesAxis, bool isIndirect, bool usePortRotate) |
Adds geometry to a constraint and sets the movable object to be constrained. | |
void | DeleteConstraintReference (NXOpen::Positioning::ConstraintReference *constraintReference) |
Removes a Positioning::ConstraintReference from the constraint. | |
void | EditConstraintReference (NXOpen::Positioning::ConstraintReference *constraintReference, NXOpen::NXObject *movableObject, NXOpen::NXObject *geometry, bool usesAxis, bool isIndirect, bool usePortRotate) |
Adds geometry to a constraint and sets the movable object to be constrained, replacing the properties of an existing reference of the constraint. | |
NXOpen::Expression * | Expression () |
Returns the expression used for constraint. | |
void | FlipAlignment () |
Reverses the constraint alignment if this is possible. | |
void | GenerateConversionReport (std::vector< NXString > &lines) |
Returns a textual conversion report this constraint from when it was converted from a Mating Constraint to an Assembly Constraint. | |
NXOpen::Positioning::Constraint::SolverStatus | GetConstraintStatus () |
Returns the solver status of a constraint. | |
NXOpen::Positioning::DisplayedConstraint * | GetDisplayedConstraint () |
Gets the Positioning::DisplayedConstraint that is in the same part as that of the constraint. | |
std::vector < NXOpen::Positioning::ConstraintReference * > | GetReferences () |
Gets all the Positioning::ConstraintReference s for the constraint. | |
bool | Persistent () |
Returns the persistent state of the constraint. | |
void | ReverseDirection () |
Reverses the constraint direction. | |
void | SetAlignmentHint (NXOpen::Positioning::Constraint::Alignment alignment) |
Set a hint as to which alignment should be used by the solver for this constraint. | |
void | SetAutomatic (bool isauto) |
Sets the flag marking the constraint as an "automatic" constraint. | |
void | SetConstraintAlignment (NXOpen::Positioning::Constraint::Alignment alignment) |
Sets the alignment behavior for the constraint. | |
void | SetConstraintType (NXOpen::Positioning::Constraint::Type constraintType) |
Sets the constraint type. | |
void | SetExpression (const NXString &expression) |
The expression used for constraint - only for distance or angle Created in NX4.0.0. | |
void | SetPersistent (bool persistent) |
Sets the persistent state of the constraint. | |
void | SetSplinePointsType (NXOpen::Positioning::Constraint::SplineType splineType) |
Sets the type of the spline. | |
void | SetSuppressed (bool suppressed) |
Sets the suppression state for the constraint. | |
NXOpen::Positioning::Constraint::SplineType | SplinePointsType () |
Returns the type of the spline. | |
bool | Suppressed () |
Returns the suppression state for the constraint. |
Constraint for use in positioning objects in NX.
For constraints between components, the subclass Positioning::ComponentConstraint should be used by preference.
To create a new instance of this class, use Positioning::Positioner::CreateConstraint
Created in NX4.0.0.
Specifies the status of a constraint.
SolverStatusNewlyCreated |
Not evaluated or suppressed since creation. |
SolverStatusSuppressed |
Constraint is suppressed. |
SolverStatusOutOfDate |
Needs evaluation. |
SolverStatusOverConstrained |
Conflicts with other constraints. |
SolverStatusNotConsistentDims |
Cannot solve with current dimension values. Model fully defined |
SolverStatusNotConsistentOther |
Cannot find a solution. Model underdefined |
SolverStatusNotConsistentUnknown |
Cannot find a solution. |
SolverStatusBetweenFixed |
Attempt to put constraint between two fixed objects. |
SolverStatusNotSolved |
Not evaluated because other parts of the model are over defined or inconsistent. |
SolverStatusSolved |
The constraint is solved and satisfied. |
SolverStatusCannotSolve |
The constraint has invalid geometry and could not be passed to the solver. |
SolverStatusDelayed |
The constraint is delayed and will not solve. |
SolverStatusIgnoredInArrangement |
The current arrangement ignores all constraints and they will not solve. |
SolverStatusInternallyInconsistent |
The constraint references invalid geometry for this constraint type. |
SolverStatusUnloadedGeometry |
The constraint could not solve as some geometry is unloaded. |
SolverStatusPendingConvertedMc |
The constraint has been converted from a mating condition and has not solved since conversion. |
Specifies the type of a constraint.
Returns the flag marking the constraint as an "automatic" constraint.
Automatic constraints are constraints created by the system, but are visible and editable by the user. Automatic constraints are automatically deleted when one of the referenced objects are deleted by update.
Created in NX5.0.0.
License requirements : assemblies ("ASSEMBLIES MODULE")
Returns the alignment behavior for the constraint.
Created in NX4.0.0.
License requirements : assemblies ("ASSEMBLIES MODULE")
Returns the constraint type.
Created in NX4.0.0.
License requirements : assemblies ("ASSEMBLIES MODULE")
NXOpen::Positioning::ConstraintReference* NXOpen::Positioning::Constraint::CreateConstraintReference | ( | NXOpen::NXObject * | movableObject, |
NXOpen::NXObject * | geometry, | ||
bool | usesAxis, | ||
bool | isIndirect | ||
) |
Adds geometry to a constraint and sets the movable object to be constrained.
movableObject | Object to be positioned by constraint |
geometry | Geometry used to define constraint |
usesAxis | Use axis of geometry |
isIndirect | Geometry is to be used indirectly to identify geometry in another part |
NXOpen::Positioning::ConstraintReference* NXOpen::Positioning::Constraint::CreateConstraintReference | ( | NXOpen::NXObject * | movableObject, |
NXOpen::NXObject * | geometry, | ||
bool | usesAxis, | ||
bool | isIndirect, | ||
bool | usePortRotate | ||
) |
Adds geometry to a constraint and sets the movable object to be constrained.
movableObject | Object to be positioned by constraint |
geometry | Geometry used to define constraint |
usesAxis | Use axis of geometry |
isIndirect | Geometry is to be used indirectly to identify geometry in another part |
usePortRotate | Use rotate vector of Routing::Port . |
void NXOpen::Positioning::Constraint::DeleteConstraintReference | ( | NXOpen::Positioning::ConstraintReference * | constraintReference | ) |
Removes a Positioning::ConstraintReference from the constraint.
Created in NX4.0.0.
License requirements : assemblies ("ASSEMBLIES MODULE")
constraintReference | The constraint reference to remove. A list of references can be obtained via Positioning::Constraint::GetReferences . |
void NXOpen::Positioning::Constraint::EditConstraintReference | ( | NXOpen::Positioning::ConstraintReference * | constraintReference, |
NXOpen::NXObject * | movableObject, | ||
NXOpen::NXObject * | geometry, | ||
bool | usesAxis, | ||
bool | isIndirect, | ||
bool | usePortRotate | ||
) |
Adds geometry to a constraint and sets the movable object to be constrained, replacing the properties of an existing reference of the constraint.
Created in NX5.0.1.
License requirements : assemblies ("ASSEMBLIES MODULE")
constraintReference | The Positioning::ConstraintReference whose properties are to be changed |
movableObject | Object to be positioned by constraint |
geometry | Geometry used to define constraint |
usesAxis | Use axis of geometry |
isIndirect | Geometry is to be used indirectly to identify geometry in another part |
usePortRotate | Use rotate vector of Routing::Port . |
Returns the expression used for constraint.
The expression will be unused unless this constraint has type distance or angle.
Created in NX4.0.0.
License requirements : assemblies ("ASSEMBLIES MODULE")
Reverses the constraint alignment if this is possible.
Created in NX4.0.0.
License requirements : assemblies ("ASSEMBLIES MODULE")
void NXOpen::Positioning::Constraint::GenerateConversionReport | ( | std::vector< NXString > & | lines | ) |
Returns a textual conversion report this constraint from when it was converted from a Mating Constraint to an Assembly Constraint.
If this isn't a converted constraint or there were no problems converting this constraint, then an empty string is returned.
Created in NX5.0.0.
License requirements : assemblies ("ASSEMBLIES MODULE")
lines | The text lines of the conversion report |
NXOpen::Positioning::Constraint::SolverStatus NXOpen::Positioning::Constraint::GetConstraintStatus | ( | ) |
Returns the solver status of a constraint.
NXOpen::Positioning::DisplayedConstraint* NXOpen::Positioning::Constraint::GetDisplayedConstraint | ( | ) |
Gets the Positioning::DisplayedConstraint that is in the same part as that of the constraint.
Note that this will be NULL if the part has not been the displayed part since the constraint was created.
std::vector<NXOpen::Positioning::ConstraintReference *> NXOpen::Positioning::Constraint::GetReferences | ( | ) |
Gets all the Positioning::ConstraintReference s for the constraint.
Returns the persistent state of the constraint.
Created in NX4.0.0.
License requirements : assemblies ("ASSEMBLIES MODULE")
Reverses the constraint direction.
This operation reverses the Positioning::ConstraintReference::Order on each Positioning::ConstraintReference . So "Inside" becomes "Outside", "Outside" becomes "Inside" and "Unknown" remains as it is.
Created in NX5.0.0.
License requirements : assemblies ("ASSEMBLIES MODULE")
void NXOpen::Positioning::Constraint::SetAlignmentHint | ( | NXOpen::Positioning::Constraint::Alignment | alignment | ) |
Set a hint as to which alignment should be used by the solver for this constraint.
If the constraint does not solve using this alignment then the hint will be ignored.
The hint can only have an effect when the alignment of [version_created("4")] the constraint, as returned by Positioning::Constraint::ConstraintAlignment , is Positioning::Constraint::AlignmentInferAlign .
The hint can only have an effect when the constraint has been explicitly added to a Positioning::Network .
Passing in Positioning::Constraint::AlignmentInferAlign as the alignment argument will have no effect.
The hint is forgotten after an update.
Created in NX4.0.0.
License requirements : assemblies ("ASSEMBLIES MODULE")
alignment | The alignment hint |
void NXOpen::Positioning::Constraint::SetAutomatic | ( | bool | isauto | ) |
Sets the flag marking the constraint as an "automatic" constraint.
Automatic constraints are constraints created by the system, but are visible and editable by the user. Automatic constraints are automatically deleted when one of the referenced objects are deleted by update.
Created in NX5.0.0.
License requirements : assemblies ("ASSEMBLIES MODULE")
isauto | The automatic state |
void NXOpen::Positioning::Constraint::SetConstraintAlignment | ( | NXOpen::Positioning::Constraint::Alignment | alignment | ) |
Sets the alignment behavior for the constraint.
Created in NX4.0.0.
License requirements : assemblies ("ASSEMBLIES MODULE")
alignment | Alignment behavior for constraint |
void NXOpen::Positioning::Constraint::SetConstraintType | ( | NXOpen::Positioning::Constraint::Type | constraintType | ) |
Sets the constraint type.
Created in NX4.0.0.
License requirements : assemblies ("ASSEMBLIES MODULE")
constraintType | constraint type |
void NXOpen::Positioning::Constraint::SetExpression | ( | const NXString & | expression | ) |
The expression used for constraint - only for distance or angle
Created in NX4.0.0.
License requirements : assemblies ("ASSEMBLIES MODULE")
expression | Name of expression used in distance or angle constraint NOTE: The full Unicode character set is not supported for this parameter. |
void NXOpen::Positioning::Constraint::SetPersistent | ( | bool | persistent | ) |
Sets the persistent state of the constraint.
Created in NX4.0.0.
License requirements : assemblies ("ASSEMBLIES MODULE")
persistent | The persistent state |
void NXOpen::Positioning::Constraint::SetSplinePointsType | ( | NXOpen::Positioning::Constraint::SplineType | splineType | ) |
Sets the type of the spline.
Only valid if the type of the constraint is set to Positioning::Constraint::TypeSplineData .
Created in NX6.0.0.
License requirements : assemblies ("ASSEMBLIES MODULE")
splineType | spline type |
void NXOpen::Positioning::Constraint::SetSuppressed | ( | bool | suppressed | ) |
Sets the suppression state for the constraint.
Created in NX4.0.0.
License requirements : assemblies ("ASSEMBLIES MODULE")
suppressed | The suppression state |
Returns the type of the spline.
Only valid if the type of the constraint is set to Positioning::Constraint::TypeSplineData .
Created in NX6.0.0.
License requirements : assemblies ("ASSEMBLIES MODULE")
Returns the suppression state for the constraint.
Created in NX4.0.0.
License requirements : assemblies ("ASSEMBLIES MODULE")