Relations
This section describes how to access relations on all models and model items in Creo Parametric using the methods provided in Web.Link.
Accessing Relations
In Web.Link, 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 a sequence 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.
    Example 1: Adding Relations between Parameters in a Solid Model
    The sample code in the file pfcRelationExamples.js located at <creo_weblink_loadpoint>/weblinkexamples/jscript demonstrates how to add relations between parameters in a solid model.
    Accessing Post Regeneration Relations
    Method and Property Introduced:
  • pfcModel.PostRegenerationRelations
  • pfcModel.RegeneratePostRegenerationRelations()
  • pfcModel.DeletePostRegenerationRelations()
  • The property pfcModel.PostRegenerationRelations lists the post-regeneration relations assigned to the model. It can be NULL, if not set.
    Note
    To work with post-regeneration relations, use the post-regeneration relations attribute in the methods pfcModel.RegeneratePostRegenerationRelations() 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().