Relations
This section describes how to access relations on all models and model items in Creo Parametric using the methods provided in Creo.JS.
Accessing Relations
In Creo.JS, the set of relations on any model or model item is represented by the pfcRelationOwner class. Models, features, surfaces, and edges inherit from this interface, because each object can be assigned relations in Creo Parametric.
Methods and Properties Introduced:
  • pfcRelationOwner.RegenerateRelations()
  • pfcRelationOwner.DeleteRelations()
  • pfcRelationOwner.Relations
  • pfcRelationOwner.EvaluateExpression()
  • 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 property pfcRelationOwner.Relations returns the list of initial relations assigned to the owner item as an array of strings.
    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.
    Accessing Post Regeneration Relations
    Method and Property Introduced:
  • pfcModel.PostRegenerationRelations
  • pfcModel.RegeneratePostRegenerationRelations()
  • pfcModel.DeletePostRegenerationRelations()
  • The property pfcModel.PostRegenerationRelations lists the postregeneration relations assigned to the model. It can be NULL, if not set.
    Note
    To work with postregeneration relations, use the postregeneration relations attribute in the methods pfcRelationOwner.RegenerateRelations() and pfcRelationOwner.DeleteRelations().
    You can regenerate the relation sets post-regeneration in a model using the method pfcModel.RegeneratePostRegenerationRelations().
    To delete all the post-regeneration relations in the specified model, call the method pfcModel.DeletePostRegenerationRelations().