Family Tables
This section describes how to use Creo Object TOOLKIT C++ classes and methods to access and manipulate family table information.
Working with Family Tables
Creo Object TOOLKIT C++ provides several methods for accessing family table information. Because every model inherits from the interface pfcFamilyMember, 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 pfcFamilyMember::GetParent.
When you now call the method pfcFamilyMember::GetParent, 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 to 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::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 method pfcFamilyTableRow::GetInstanceName returns the name that corresponds to the invoking row object.
To control whether the instance can be changed or removed, call the methods pfcFamilyTableRow::GetIsLocked and pfcFamilyTableRow::SetIsLocked.
Accessing Columns
Methods Introduced:
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 method pfcFamilyTableColumn::GetSymbol returns the string symbol at the top of the column, such as D4 or F5.
The method pfcFamilyTableColumn::GetType returns an enumerated value indicating the type of parameter governed by the column in the family table.
The method pfcFamColModelItem::GetRefItem returns the pfcModelItem (pfcFeature or pfcDimension) controlled by the column, whereas pfcFamColParam::GetRefParam returns the pfcParameter controlled by the column.
Accessing Cell Information
Methods Introduced:
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 pfcParamValue::GetStringValue, pfcParamValue::GetIntValue, pfcParamValue::GetDoubleValue, and pfcParamValue::GetBoolValue methods are used to get the different types of parameter values.
Creating Family Table Instances
Methods Introduced:
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:
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.
Operations on Family Table Instances
Methods Introduced:
Use the method wfcWFamilyTableRow::GetModelFromDisk to retrieve an instance of a model from the disk as an object of the class wfcWModel.
Use the method wfcWFamilyTableRow::GetModelFromSession to retrieve the handle to the instance model for the given instance if the model is in session.
Use the method wfcWFamilyTableRow::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 wfcWFamilyTableRow::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 wfcWFamilyMember::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 wfcWFamilyMember::EditFamilyTable to edit the specified family table using the Pro/TABLE or another text editor.
Use the method wfcWFamilyMember::EraseFamilyTable to erase the specified family table.
Use the method wfcWFamilyMember::GetFamilyTableStatus to determine the validity status of the family table.
Use the method wfcWFamilyMember::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 wfcWFamilyMember::ShowFamilyTable to display the family table using Pro/TABLE or another text editor.