Family Tables
This section describes how to use Web.Link classes and methods to access and manipulate family table information.
Working with Family Tables
Web.Link provides several methods for accessing family table information. Because every model inherits from the class pfcFamilyMember, every model can have a family table associated with it.
Accessing Instances
Methods and Properties Introduced:
  • pfcFamilyMember.Parent
  • pfcFamilyMember.GetImmediateGenericInfo()
  • pfcFamilyMember.GetTopGenericInfo()
  • pfcFamilyTableRow.CreateInstance()
  • pfcFamilyMember.ListRows()
  • pfcFamilyMember.GetRow()
  • pfcFamilyMember.RemoveRow()
  • pfcFamilyTableRow.InstanceName
  • pfcFamilyTableRow.IsLocked
  • To get the generic model for an instance, call the property pfcFamilyMember.Parent.
    From Pro/ENGINEER Wildfire 4.0 onwards, the behavior of the property pfcFamilyMember.Parent has changed as a result of performance improvement in family table retrieval mechanism. When you now call the property pfcFamilyMember.Parent, it throws an exception pfcXToolkitCantOpen, if the immediate generic of a model instance in a nested family table is currently not in session. Handle this exception and use the method pfcFamilyMember.GetImmediateGenericInfo() to get the model descriptor of the immediate generic model. This information can be used to retrieve the immediate generic model.
    If you wish to switch off the above behavior and continue to run legacy applications in the pre-Wildfire 4.0 mode, set the configuration option retrieve_instance_dependencies to instance_and_generic_deps.
    To get the model descriptor of the top generic model, call the method pfcFamilyMember.GetTopGenericInfo().
    Similarly, the method pfcFamilyTableRow.CreateInstance() returns an instance model created from the information stored in the pfcFamilyTableRow object.
    The method pfcFamilyMember.ListRows() returns a sequence of all rows in the family table, whereas pfcFamilyMember.ListRows() gets the row object with the name you specify.
    Use the method pfcFamilyMember.RemoveRow() to permanently delete the row from the family table.
    The property pfcFamilyTableRow.InstanceName returns the name that corresponds to the invoking row object.
    To control whether the instance can be changed or removed, call the property pfcFamilyTableRow.IsLocked.
    Accessing Columns
    Methods and Properties Introduced:
  • pfcFamilyMember.ListColumns()
  • pfcFamilyMember.GetColumn()
  • pfcFamilyMember.RemoveColumn()
  • pfcFamilyTableColumn.Symbol
  • pfcFamilyTableColumn.Type
  • pfcFamColModelItem.RefItem
  • pfcFamColParam.RefParam
  • The method pfcFamilyMember.ListColumns() returns a sequence of all columns in the family table.
    The method pfcFamilyMember.GetColumn() returns a family table column, given its symbolic name.
    To permanently delete the column from the family table and all changed values in all instances, call the method pfcFamilyMember.RemoveColumn().
    The property pfcFamilyTableColumn.Symbol returns the string symbol at the top of the column, such as D4 or F5.
    The property pfcFamilyTableColumn.Type returns an enumerated value indicating the type of parameter governed by the column in the family table.
    The property pfcFamColModelItem.RefItem returns the pfcModelItem (Feature or Dimension) controlled by the column, whereas pfcFamColParam.RefParam returns the Parameter controlled by the column.
    Accessing Cell Information
    Methods and Properties Introduced:
  • pfcFamilyMember.GetCell()
  • pfcFamilyMember.GetCellIsDefault()
  • pfcFamilyMember.SetCell()
  • pfcParamValue.StringValue
  • pfcParamValue.IntValue
  • pfcParamValue.DoubleValue
  • pfcParamValue.BoolValue
  • The method pfcFamilyMember.GetCell() returns a string pfcParamValue that corresponds to the cell at the intersection of the row and column arguments. Use the method pfcFamilyMember.GetCellIsDefault() to check if the value of the specified cell is the default value, which is the value of the specified cell in the generic model.
    The method pfcFamilyMember.SetCell() assigns a value to a column in a particular family table instance.
    The properties pfcParamValue.StringValue, pfcParamValue.IntValue, pfcParamValue.DoubleValue, and pfcParamValue.BoolValue are used to get the different types of parameter values.
    Creating Family Table Instances
    Methods Introduced:
  • pfcFamilyMember.AddRow()
  • MpfcModelItem.CreateStringParamValue()
  • MpfcModelItem.CreateIntParamValue()
  • MpfcModelItem.CreateDoubleParamValue()
  • MpfcModelItem.CreateBoolParamValue()
  • Use the method pfcFamilyMember.AddRow() to create a new instance with the specified name, and, optionally, the specified values for each column. If you do not pass in a set of values, the value * will be assigned to each column. This value indicates that the instance uses the generic value.
    Creating Family Table Columns
    Methods Introduced:
  • pfcFamilyMember.CreateDimensionColumn()
  • pfcFamilyMember.CreateParamColumn()
  • pfcFamilyMember.CreateFeatureColumn()
  • pfcFamilyMember.CreateComponentColumn()
  • pfcFamilyMember.CreateCompModelColumn()
  • pfcFamilyMember.CreateGroupColumn()
  • pfcFamilyMember.CreateMergePartColumn()
  • pfcFamilyMember.CreateColumn()
  • pfcFamilyMember.AddColumn()
  • MpfcModelItem.CreateStringParamValue()
  • The above methods initialize a column based on the input argument. These methods assign the proper symbol to the column header.
    The method pfcFamilyMember.CreateColumn() creates a new column given a properly defined symbol and column type. The results of this call should be passed to the method pfcFamilyMember.AddColumn() to add the column to the model's family table.
    The method pfcFamilyMember.AddColumn() adds the column to the family table. You can specify the values; if you pass nothing for the values, the method assigns the value * to each instance to accept the column’s default value.
    Example Code: Adding Dimensions to a Family Table
    The sample code in the file pfcFamilyMemberExamples.js located at <creo_weblink_loadpoint>/weblinkexamples/jscript shows a utility method that adds all the dimensions to a family table. The program lists the dependencies of the assembly and loops through each dependency, assigning the model to a new column in the family table. All the dimensions, parameters, features, and components could be added to the family table using a similar method.