Relations
This section describes how to access relations on all models and model items in Creo application using the methods provided in Creo Object TOOLKIT C++.
Accessing Relations
In Creo Object TOOLKIT C++, the set of relations on any model or model item is represented by the pfcRelationOwner interface. Models, features, surfaces, and edges inherit from this interface, because each object can be assigned relations in Creo application.
Methods Introduced:
The method
pfcRelationOwner::RegenerateRelations regenerates the relations assigned to the owner item. It also determines whether the specified relation set is valid.
The method
pfcRelationOwner::DeleteRelations deletes all the relations assigned to the owner item.
The method
pfcRelationOwner::GetRelations returns the list of initial relations assigned to the owner item as a sequence of strings.
The method
pfcRelationOwner::SetRelations assigns the sequence of strings as the new relations to the owner item.
The method
pfcRelationOwner::EvaluateExpression evaluates the given relations-based expression, and returns the resulting value in the form of the
pfcParamValue object. Refer to the section
The ParamValue Object in the
section Dimensions and Parameters for more information on this object.
The method
wfcWRelationOwner::EvaluateExpression has been deprecated. Use the method
wfcWRelationOwner::EvaluateExpressionWithUnits instead.
Use the method
wfcWRelationOwner::EvaluateExpressionWithUnits if you want the units of the relation to be considered while evaluating the expression. Specify the input argument
Consider_units as true to consider the units. In this case, the result of the relation is returned along with its unit as
wfcParamValueWithUnits object. Refer to the section
The ParamValue Object in the
section Dimensions and Parameters for more information on this object.
The method
wfcWRelationOwner::UseUnits specifies if units must be considered while solving the specified relation. Use the method
wfcWRelationOwner::UnitsUsed to check if units will be considered while solving the relation.