Family Tables
This section describes how to use Creo Object TOOLKIT Java classes and methods to access and manipulate family table information.
Working with Family Tables
Creo Object TOOLKIT Java provides several methods for accessing family table information. Because every model inherits from the interfacepfcFamily.FamilyMember, every model can have a family table associated with it.
Accessing Instances
Methods Introduced:
To get the generic model for an instance, call the method pfcFamily.FamilyMember.GetParent.
From Pro/ENGINEER Wildfire 4.0 onwards, the behavior of the method pfcFamily.FamilyMember.GetParent has changed as a result of performance improvement in family table retrieval mechanism. When you now call the method pfcFamily.FamilyMember.GetParent, it throws an exception pfcExceptions.XToolkitCantOpen, 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 pfcFamily.FamilyMember.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 pfcFamily.FamilyMember.GetTopGenericInfo.
Similarly, the method pfcFamily.FamilyTableRow.CreateInstance returns an instance model created from the information stored in the FamilyTableRow object.
The method pfcFamily.FamilyMember.ListRows returns a sequence of all rows in the family table, whereas pfcFamily.FamilyMember.GetRow gets the row object with the name you specify.
Use the method pfcFamily.FamilyMember.RemoveRow to permanently delete the row from the family table.
The method pfcFamily.FamilyTableRow.GetInstanceName returns the name that corresponds to the invoking row object.
To control whether the instance can be changed or removed, call the methods pfcFamily.FamilyTableRow.GetIsLockedand pfcFamily.FamilyTableRow.SetIsLocked.
Accessing Columns
Methods Introduced:
The method pfcFamily.FamilyMember.ListColumns returns a sequence of all columns in the family table.
The method pfcFamily.FamilyMember.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 pfcFamily.FamilyMember.RemoveColumn.
The method pfcFamily.FamilyTableColumn.GetSymbol returns the string symbol at the top of the column, such as D4 or F5.
The method pfcFamily.FamilyTableColumn.GetType returns an enumerated value indicating the type of parameter governed by the column in the family table.
The method pfcFamily.FamColModelItem.GetRefItem returns the ModelItem (Feature or Dimension) controlled by the column, whereas pfcFamily.FamColParam.GetRefParam returns the Parameter controlled by the column.
Accessing Cell Information
Methods Introduced:
The method pfcFamily.FamilyMember.GetCell returns a string ParamValue that corresponds to the cell at the intersection of the row and column arguments. Use the method pfcFamily.FamilyMember.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 pfcFamily.FamilyMember.SetCell assigns a value to a column in a particular family table instance.
The pfcModelItem.ParamValue.GetStringValue, pfcModelItem.ParamValue.GetIntValue, pfcModelItem.ParamValue.GetDoubleValue, and pfcModelItem.ParamValue.GetBoolValue methods are used to get the different types of parameter values.
Creating Family Table Instances
Methods Introduced:
Use the method pfcFamily.FamilyMember.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:
The above methods initialize a column based on the input argument. These methods assign the proper symbol to the column header.
The method pfcFamily.FamilyMember.CreateColumn creates a new column given a properly defined symbol and column type. The results of this call should be passed to the method pfcFamily.FamilyMember.AddColumn to add the column to the model's family table.
The method pfcFamily.FamilyMember.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.
Operations on Family Table Instances
Methods Introduced:
Use the method wfcFamily.WFamilyTableRow.GetModelFromDisk to retrieve an instance of a model from the disk as an object of the class wfcModel.WModel.
Use the method wfcFamily.WFamilyTableRow.GetModelFromSession o retrieve the handle to the instance model for the given instance if the model is in session..
Use the method wfcFamily.WFamilyTableRow.IsFlatState to identify if the family table instance, that is, a completely unbent instance of a sheet metal part. This method returns the value true if the family table instance is a flat state instance.
Use the method wfcFamily.WFamilyTableRow.IsModifiable to check if the given instance of a family table can be modified. This method returns the value true if the instance is modifiable.The input parameter for this method is:
•  ShowUI—Specifies whether the Conflicts dialog box should be shown to resolve the conflicts, if detected. Pass the value true to show the dialog box.
Use the method wfcFamily.WFamilyMember.SelectRows to select one or more instances from the specified family table. The input parameter for this method is:
•  AllowMultiSelect—Specify the value true to enable the selection of more than one instance in the family table.
Family Table Utilities
Use the method wfcFamily.WFamilyMember.EditFamilyTable to edit the specified family table using the Pro/TABLE or another text editor.
Use the method wfcFamily.WFamilyMember.EraseFamilyTable to erase the specified family table.
Use the method wfcFamily.WFamilyMember.GetFamilyTableStatus to determine the validity status of the family table.
Use the method wfcFamily.WFamilyMember.IsModifiable to check whether the specified family table can be modified. This method returns the value true if the family table is modifiable. The input parameter for this method is:
•  ShowUI—Specifies whether the Conflicts dialog box should be shown to resolve the conflicts, if detected. Pass the value true to show the dialog box.
Use the method wfcFamily.WFamilyMember.ShowFamilyTable to display the family table using Pro/TABLE or another text editor.