Relations
 
This section describes how to access relations on all models and model items in Creo Parametric using the functions provided in Creo TOOLKIT.
Functions Introduced:
Superseded Functions:
The object ProRelset represents the entire set of relations on any model or model item. It is an opaque handle whose contents can be accessed only through the functions described in this section.
Creo TOOLKIT can only access the relations of the models and model item types as listed in the table below:
Model Types
Description
PRO_PART
Part
PRO_ASSEMBLY
Assembly
PRO_DRAWING
Drawing
PRO_REPORT
Report
PRO_DIAGRAM
Diagram
PRO_DWGFORM
Format
PRO_UDF
User-defined feature
PRO_FEATURE
Feature
PRO_SURFACE
Surface
PRO_EDGE
Edge
PRO_WELD_PARAMS
Weld parameters
PRO_BND_TABLE
Bend table
PRO_EXTOBJ
External objects
PRO_PATREL_FIRST_DIR
Pattern direction 1
PRO_PATREL_SECOND_DIR
Pattern direction 2
PRO_RELOBJ_QUILT
Quilt
PRO_RELOBJ_CRV
Curve
PRO_RELOBJ_COMP_CRV
Compound curve
PRO_RELOBJ_ANNOT_ELEM
Annotation Element
PRO_RELOBJ_NC_STEP_OBJECT
NC Step Table Entry
PRO_RELOBJ_NC_STEP_MODEL
NC Step Table Model
The function ProModelitemToRelset() outputs a ProRelset object that contains the set of initial relations owned by the given model item. (Note that not all model items can have relations sets associated with them—only the types listed in the table.)
Use the function ProRelsetPostregenerationInit() to initialize the post-regeneration data object ProRelset. The object contains post-regeneration relations in the specified model.
Note:
 
According to your requirement you can pass the initial relations, or the post-regeneration relations data object, ProRelset as input to the functions ProRelsetRelationsGet(), ProRelsetRelationsSet(), ProRelsetRegenerate() and ProRelsetDelete().
To get the relations of a feature pattern, the model item type should be either PRO_PATREL_FIRST_DIR or PRO_PATREL_SECOND_DIR, and the identifier should be that of the dimension on the pattern leader that drives the pattern in that direction. To find the identifiers of the pattern dimension, use the functions described in the section Manipulating Patterns.
The function ProSolidRelsetVisit() enables you to visit all the relation sets on every model item in a model. Like other visit functions, it calls a user-supplied action function for each relation set, although there is no filter function. If the user-supplied function returns any status other than PRO_TK_NO_ERROR, visiting will stop. The model types PRO_PART, PRO_ASSEMBLY, and PRO_DRAWING are supported.
The function ProRelsetToModelitem() outputs the model item that is the owner of the specified ProRelset.
You can regenerate a relation set using the function ProRelsetRegenerate(). This function also determines whether the specified relation set is valid. If an error occurred, the function returns a status other than PRO_TK_NO_ERROR.
To create a new relation set for a model item, use the function ProRelsetCreate(). If a relation set already exists for that item, the function returns PRO_TK_E_FOUND.
To delete all the relations in a specified relation set, call the function ProRelsetDelete().
The function ProRelsetRelationsGet() extracts the text of a set of relations described by a ProRelset object. This function takes two arguments: the ProRelset for the relation set and a preallocated expandable array. The elements of the expandable array are of type ProLine (wide strings).
The function ProRelsetRelationsSet() creates a ProRelset object from an expandable array of ProLine objects that describes the relations as text. For details of the syntax and use of relations, see the Creo Parametric help.
Note:
 
Existing relations will be overwritten by a call to ProRelsetRelationsSet().
The function ProRelationEvalWithUnits() evaluates a line of a relation set and outputs the resulting value in the form of a ProParamvalue structure. Specify the input argument consider_units as true if you want the units of the relation to be considered while evaluating the relation. In this case, the result of the relation is returned along with its unit. See the section Core: Parameters for a description of this data structure. The use of special pattern relation symbols such as memb_v or idx1 is not supported; instead, replace these symbols with the corresponding dimension value or number, and evaluate them individually.
The function ProRelationEvalWithUnits() cannot be used for referencing external symbols.
In Creo Parametric 8.0.0.0 and later, the function ProRelationEvalWithUnits() is deprecated. Use the function ProRelationEvalWithUnitsRefResolve() instead.
The function ProRelationEvalWithUnitsRefResolve() evaluates the expression that is specified on the right side of a relation line and returns the value in the form of ProParamvalue structure. Relations with symbols that are referenced by parameters or dimensions on a different model can be evaluated using the function ProRelationEvalWithUnitsRefResolve(). Specify the input argument consider_units as true if you want the units of the relation to be considered while evaluating the relation. In this case, the result of the relation is returned along with its unit. See the section Core: Parameters for a description of this data structure. The use of special pattern relation symbols such as memb_v or idx1 is not supported; instead, replace these symbols with the corresponding dimension value or number, and evaluate them individually.
The function ProRelsetUnitsSensitiveSet() specifies that units must be considered while solving the specified relation. Use the function ProRelsetIsUnitsSensitive() to check if units must be considered while solving the relation.
도움이 되셨나요?