Family Tables
This section describes how to use Creo.JSCreo.JS classes and methods to access and manipulate family table information.
Working with Family Tables
Creo.JS provides several methods for accessing family table information. Because every model inherits from the classpfcFamilyMember, every model can have a family table with which it is associated.
Accessing Instances
Methods and Properties Introduced:
  • pfcFamilyMember.Parent
  • pfcFamilyMember.GetImmediateGenericInfo
  • pfcFamilyMember.GetTopGenericInfo()
  • pfcFamilyTableRow.CreateInstance()
  • pfcFamilyMember.ListRows()
  • pfcFamilyMember.GetRow()
  • pfcFamilyMember.RemoveRow()
  • pfcFamilyTableRow.InstanceName
  • pfcFamilyTableRow.IsLocked
  • pfcFamilyTableRow.IsExtLocked
  • pfcFamilyTableRow.IsVerified
  • To get the generic model for an instance, call the property pfcFamilyMember.Parent.
    The property pfcFamilyMember.Parent has changed as a result of performance improvement in family table retrieval mechanism. 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 property pfcFamilyMember.GetImmediateGenericInfo to get the model descriptor of the immediate generic model. You can use this information to retrieve the immediate generic model.
    To get the model descriptor of the top generic model, call the method pfcFamilyMember.GetTopGenericInfo().
    Similarly, the method pfcFamilyMember.GetTopGenericInfo() returns an instance model created from the information stored in the pfcFamilyTableRow object.
    The method pfcFamilyMember.ListRows() returns an array of all rows in the family table, whereas pfcFamilyMember.GetRow() 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.
    The property pfcFamilyTableRow.IsExtLocked specifies if the instance is locked by external application.
    The property pfcFamilyTableRow.IsVerified specifies the verification status of the instance.
    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 an array 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 the type of the column using the enumerated data type pfcFamilyColumnType.The values indicate the type of parameter governed by the column in the family table.
    The property pfcFamColModelItem.RefItem returns the pfcModelItem (pfcFeature or pfcDimension) controlled by the column, whereas pfcFamColParam.RefParam() returns the Parameter controlled by the column.
    Accessing Cell Information
    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 property 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()
  • pfcCreateStringParamValue()
  • pfcCreateIntParamValue()
  • pfcCreateDoubleParamValue()
  • pfcCreateBoolParamValue()
  • 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 * is 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()
  • pfcCreateStringParamValue()
  • 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 family table for the model.
    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 default value in the column.