NX Open C++ Reference Guide
Public Types | Public Member Functions | List of all members
NXOpen::Positioning::Constraint Class Reference

Constraint for use in positioning objects in NX. More...

Inheritance diagram for NXOpen::Positioning::Constraint:
NXOpen::NXObject NXOpen::TaggedObject NXOpen::INXObject NXOpen::Positioning::ComponentConstraint

Public Types

enum  Alignment { AlignmentInferAlign, AlignmentCoAlign, AlignmentContraAlign }
 指定约束中使用的定向几何体的对齐方式.  More...
 
enum  SolverStatus {
  SolverStatusNewlyCreated, SolverStatusSuppressed, SolverStatusOutOfDate, SolverStatusOverConstrained,
  SolverStatusNotConsistentDims, SolverStatusNotConsistentOther, SolverStatusNotConsistentUnknown, SolverStatusBetweenFixed,
  SolverStatusNotSolved, SolverStatusSolved, SolverStatusCannotSolve, SolverStatusDelayed,
  SolverStatusIgnoredInArrangement, SolverStatusInternallyInconsistent, SolverStatusUnloadedGeometry, SolverStatusPendingConvertedMc,
  SolverStatusConflictingWithWave
}
 指定约束的状态.  More...
 
enum  SplineType { SplineTypeByPoles, SplineTypeByPoints, SplineTypeInvalid }
 指定样条点如何定义样条的形状.  More...
 
enum  Type {
  TypeUndefined, TypeTouch, TypeConcentric, TypeFix,
  TypeDistance, TypeParallel, TypePerpendicular, TypeCenter12,
  TypeCenter22, TypeAngle, TypeFit, TypeBond,
  TypeOrientAngle, TypeSplineData, TypeSplineLength, TypeLinearPattern,
  TypeCircularPattern, TypeLinear2dPattern, TypeRadiantPattern, TypeAlignLock
}
 指定的类型的有约束 .  More...
 
- Public Types inherited from NXOpen::NXObject
 Specifies attribute type. More...
 Specifies the format of the date and time attribute. More...

Public Member Functions

bool Automatic ()
 返回将约束标记为“自动”约束的标志。. 
 
NXOpen::Positioning::Constraint::Alignment ConstraintAlignment ()
 返回约束的对齐行为. 
 
NXOpen::Positioning::Constraint::Type ConstraintType ()
 返回的约束类型. 
 
NXOpen::Positioning::ConstraintReferenceCreateConstraintReference (NXOpen::NXObject *movableObject, NXOpen::NXObject *geometry, bool usesAxis, bool isIndirect)
 将几何添加到约束,并设置要约束的移动对象. 
 
NXOpen::Positioning::ConstraintReferenceCreateConstraintReference (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)
 删除一个定位 Positioning::ConstraintReference from the constraint.
 
void EditConstraintReference (NXOpen::Positioning::ConstraintReference *constraintReference, NXOpen::NXObject *movableObject, NXOpen::NXObject *geometry, bool usesAxis, bool isIndirect, bool usePortRotate)
 将几何添加到约束,并设置要约束的可移动对象,替换现有约束引用的属性. 
 
NXOpen::ExpressionExpression ()
 返回用于约束的表达式. 
 
void FlipAlignment ()
 如果可能,则反转约束对齐方式。
 
void GenerateConversionReport (std::vector< NXString > &lines)
 返回文本转换报告从将约束转换为程序集约束时的此约束. 
 
NXOpen::Positioning::Constraint::SolverStatus GetConstraintStatus ()
 返回约束的求解器状态. 
 
NXOpen::Positioning::DisplayedConstraintGetDisplayedConstraint ()
 Gets the Positioning::DisplayedConstraint 这与约束的内容相同. 
 
std::vector
< NXOpen::Positioning::ConstraintReference * > 
GetReferences ()
 获取约束的所有约束引用Positioning::ConstraintReference s for the constraint.
 
bool Persistent ()
 返回约束的持久状态. 
 
void ReverseDirection ()
 反转约束方向 . 
 
void SetAlignmentHint (NXOpen::Positioning::Constraint::Alignment alignment)
 设置一个提示,说明该约束的求解器应该使用哪一个对齐方式. 
 
void SetAutomatic (bool isauto)
 将标志标记为“自动”约束的标志. 
 
void SetConstraintAlignment (NXOpen::Positioning::Constraint::Alignment alignment)
 设置约束的对齐行为. 
 
void SetConstraintType (NXOpen::Positioning::Constraint::Type constraintType)
 设置约束类型 . 
 
void SetExpression (const NXString &expression)
 用于约束的表达式,仅用于距离或角度
Created in NX4.0.0.
 
void SetExpression (const char *expression)
 The expression used for constraint - only for distance or angle
Created in NX4.0.0.
 
void SetPersistent (bool persistent)
 设置约束的持久状态. 
 
void SetSplinePointsType (NXOpen::Positioning::Constraint::SplineType splineType)
 集合类型的样条. 
 
void SetSuppressed (bool suppressed)
 设置约束的抑制状态. 
 
NXOpen::Positioning::Constraint::SplineType SplinePointsType ()
 返回的类型的样条. 
 
bool Suppressed ()
 返回约束的抑制状态. 
 
- Public Member Functions inherited from NXOpen::NXObject
- Public Member Functions inherited from NXOpen::TaggedObject
tag_t GetTag () const
 
<b>Deprecated</b>:<br>

   Use Tag instead.

 
tag_t Tag () const
 Returns the tag of this object.
 
- Public Member Functions inherited from NXOpen::INXObject
NXOpen::INXObjectFindObject (const char *journalIdentifier)
 Finds the NXObject with the given identifier as recorded in a journal.
 
void SetName (const char *name)
 Sets the custom name of the object.
 

Detailed Description

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.

Member Enumeration Documentation

Specifies alignment of directed geometries used in a constraint.

Enumerator:
AlignmentInferAlign 

Allow the solver to decide the alignment.

AlignmentCoAlign 

Directions are the same.

AlignmentContraAlign 

Directions are opposite.

Specifies the status of a constraint.

Enumerator:
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.

SolverStatusConflictingWithWave 

The constraint has been suppressed because it's conflicting with WAVE.

Specifies how the spline points define the shape of the spline.

Enumerator:
SplineTypeByPoles 

Spline points define control points.

SplineTypeByPoints 

Spline points define interpolation/through points.

SplineTypeInvalid 

Not a valid spline constraint.

Specifies the type of a constraint.

Enumerator:
TypeUndefined 

No type.

TypeTouch 

Two geometries touch.

TypeConcentric 

Two geometries share a center and plane.

TypeFix 

One movable object fixed.

TypeDistance 

Two geometries have a specified distance between them.

TypeParallel 

Two geometries are parallel.

TypePerpendicular 

Two geometries are perpendicular.

TypeCenter12 

One geometry is positioned mid-way between two others.

TypeCenter22 

An implicit plane between two geometries of one movable object is positioned mid-way between two others.

TypeAngle 

Two geometries have a specified angle between them.

TypeFit 

Two geometries are coincident.

TypeBond 

A number of movable objects form a rigid group.

TypeOrientAngle 

Two geometries have a specified angle between them about an axis.

TypeSplineData 

A spline and its defining points.

TypeSplineLength 

Constrains the curve length of a spline.

TypeLinearPattern 

For internal use only.

TypeCircularPattern 

For internal use only.

TypeLinear2dPattern 

For internal use only.

TypeRadiantPattern 

For internal use only.

TypeAlignLock 

Two geometries are constrained to have a common axis and no rotation about it.

Member Function Documentation

bool NXOpen::Positioning::Constraint::Automatic ( )

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")

NXOpen::Positioning::Constraint::Alignment NXOpen::Positioning::Constraint::ConstraintAlignment ( )

Returns the alignment behavior for the constraint.


Created in NX4.0.0.

License requirements : assemblies ("ASSEMBLIES MODULE")

NXOpen::Positioning::Constraint::Type NXOpen::Positioning::Constraint::ConstraintType ( )

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.

@return  The new @link Positioning::ConstraintReference Positioning::ConstraintReference@endlink  


Created in NX4.0.0.

License requirements : assemblies ("ASSEMBLIES MODULE")

Parameters
movableObjectObject to be positioned by constraint
geometryGeometry used to define constraint
usesAxisUse axis of geometry
isIndirectGeometry 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.

@return  The new @link Positioning::ConstraintReference Positioning::ConstraintReference@endlink  


Created in NX4.0.0.

License requirements : assemblies ("ASSEMBLIES MODULE")

Parameters
movableObjectObject to be positioned by constraint
geometryGeometry used to define constraint
usesAxisUse axis of geometry
isIndirectGeometry is to be used indirectly to identify geometry in another part
usePortRotateUse 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")

Parameters
constraintReferenceThe 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")

Parameters
constraintReferenceThe Positioning::ConstraintReference whose properties are to be changed
movableObjectObject to be positioned by constraint
geometryGeometry used to define constraint
usesAxisUse axis of geometry
isIndirectGeometry is to be used indirectly to identify geometry in another part
usePortRotateUse rotate vector of Routing::Port .
NXOpen::Expression* NXOpen::Positioning::Constraint::Expression ( )

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")

void NXOpen::Positioning::Constraint::FlipAlignment ( )

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")

Parameters
linesThe text lines of the conversion report
NXOpen::Positioning::Constraint::SolverStatus NXOpen::Positioning::Constraint::GetConstraintStatus ( )

Returns the solver status of a constraint.

@return  The solver status of the constraint 


Created in NX4.0.0.

License requirements : assemblies ("ASSEMBLIES MODULE")

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.
@return  


Created in NX7.5.0.

License requirements : assemblies ("ASSEMBLIES MODULE")

std::vector<NXOpen::Positioning::ConstraintReference *> NXOpen::Positioning::Constraint::GetReferences ( )

Gets all the Positioning::ConstraintReference s for the constraint.

@return  ConstraintReferences used by this constraint 


Created in NX4.0.0.

License requirements : assemblies ("ASSEMBLIES MODULE")

bool NXOpen::Positioning::Constraint::Persistent ( )

Returns the persistent state of the constraint.


Created in NX4.0.0.

License requirements : assemblies ("ASSEMBLIES MODULE")

void NXOpen::Positioning::Constraint::ReverseDirection ( )

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")

Parameters
alignmentThe 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")

Parameters
isautoThe 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")

Parameters
alignmentAlignment 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")

Parameters
constraintTypeconstraint 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")

Parameters
expressionName of expression used in distance or angle constraint
NOTE: The full Unicode character set is not supported for this parameter.
void NXOpen::Positioning::Constraint::SetExpression ( const char *  expression)

The expression used for constraint - only for distance or angle
Created in NX4.0.0.



License requirements : assemblies ("ASSEMBLIES MODULE")

Parameters
expressionName 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")

Parameters
persistentThe 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")

Parameters
splineTypespline 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")

Parameters
suppressedThe suppression state
NXOpen::Positioning::Constraint::SplineType NXOpen::Positioning::Constraint::SplinePointsType ( )

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")

bool NXOpen::Positioning::Constraint::Suppressed ( )

Returns the suppression state for the constraint.


Created in NX4.0.0.

License requirements : assemblies ("ASSEMBLIES MODULE")


The documentation for this class was generated from the following file:
Copyright 2013 Siemens Product Lifecycle Management Software Inc. All Rights Reserved.