Core: Family Tables
This section describes how to use Creo TOOLKIT functions to manipulate the family table for an object.
Family Table Objects
To enable access to family tables, Creo TOOLKIT implements the following objects (all DHandles):
•  ProFamtable—A structure that contains the owner, type, and integer identifier of a family table.
•  ProFaminstance—A structure that contains the name of a family table instance and the handle of the family table to which it belongs.
•  ProFamtableItem—A structure that contains the type, name, and owner of a family table item (or column).
Family Table Utilities
Functions Introduced:
Before you can manipulate the family table information stored in an object, you must get the handle to its family table using the function ProFamtableInit(). Then use ProFamtableCheck() to determine whether the family table is empty (for a ProSolid, ProPart, or ProAssembly object, use ProSolidFamtableCheck()
The function ProFamtableEdit() opens a Pro/TABLE window for editing the specified family table, producing the same effect as the Creo Parametric command Edit in the Family Table dialog box.
Similarly, a call to ProFamtableShow() presents the family table in the same manner as the Creo Parametric command Family Tab, Show.
The function ProFamtableErase() clears the family from the current session, similar to the Creo Parametric command Family Tab, Erase Table.
The function ProFamtableIsModifiable() checks whether the specified family table can be modified.
Visiting Family Tables
Functions Introduced:
As with the other Creo TOOLKIT traversal functions, the traversal functions for family tables visit family table objects and pass each object to action and filter functions that you supply.
For example, the function ProFamtableInstanceVisit() visits all the family’s instances and calls the user-supplied functions of type ProFamtableInstanceAction() and ProFamtableInstanceFilter().
The function ProFamtableItemVisit() visits each family table item (or column) and calls the user-supplied functions of type ProFamtableItemAction() and ProFamtableItemFilter().
Operations on Family Table Instances
Functions Introduced:
The functions in this section enable you to programmatically manipulate instances that appear in a family table.
The function ProFaminstanceValueGet() retrieves the value of the family table item for the specified family table instance. Use the function ProFaminstanceValueSet() to change the value of the specified family table item.
For the specified instance, use the function ProFaminstanceFamtableItemIsDefault() to determine if the specified item has the default value, which is the value of the specified item in the generic model.
The functions ProFaminstanceValueGet(), ProFaminstanceValueSet(), and ProFaminstanceFamtableItemIsDefault() require the instance and the item handles as input values, both of which are available via the visit functions.
The function ProFaminstanceAdd() adds an instance to a family table. Note that you must initialize the handle to the new instance (using ProFaminstanceInit()) before adding the instance to the table.
Use the function ProFaminstanceRemove() to remove the specified instance from the family table.
The function ProFaminstanceMdlGet() retrieves the handle to the instance model for the given instance that is in session.
To erase an instance model from memory, call the function ProFaminstanceErase().
The function ProFaminstanceCheck() checks the existence and lock status of the specified instance. Use the function ProFaminstanceLock() to make changes to the lock status of an instance.
The function ProFaminstanceIsModifiable() checks whether the given instance of a family table can be modified.
Given the instance handle, the function ProFaminstanceRetrieve() retrieves an instance of a model from disk. Note that you must allocate space for the resulting ProMdl object. In addition, you must call ProSolidDisplay() to display the instance model.
The function ProFaminstanceGenericGet() retrieves the generic model handle for a given instance model. This function includes the ability to choose between the immediate and the top-level generic models.
From Pro/ENGINEER Wildfire 4.0 onwards, the behavior of the function ProFaminstanceGenericGet() has changed as a result of performance improvement in family table retrieval. When you now call the function ProFaminstanceGenericGet() with the flag immediate set to TRUE, the function returns a new error code PRO_TK_CANT_OPEN if the immediate generic is currently not in session. Use the function ProFaminstanceImmediategenericinfoGet() to get the name and model type of the immediate generic model. This information can be used to retrieve the immediate generic model.
If you wish to turn-off this 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.
The function ProFaminstanceIsVerified() identifies whether the instance has been verified, and whether the verification succeeded or failed.
The function ProFaminstanceIsExtLocked() identifies whether the instance has been locked by an external application.
The function ProFaminstanceIsFlatState() identifies whether an instance is a sheetmetal flat state instance.
Operations on Family Table Items
Functions Introduced:
These functions enable you to programmatically manipulate family table items (column values).
The function ProFamtableItemAdd() adds the specified item to a family table. Similarly, ProFamtableItemRemove() removes the specified item from the family table.
The functions ProFamtableItemToModelitem() and ProModelitemToFamtableItem() convert between ProFamtableItem and ProModelitem objects. Note that user selections (ProSelection objects) can be converted to ProFamtableItem objects by calling the functions ProSelectionModelitemGet() and ProModelitemToFamtableItem().
The functions ProFamtableItemToParameter() and ProParameterToFamtableItem() convert between ProFamtableItem and ProParameter objects. Note that you might need to call ProParameterToFamtableItem() after calling ProParameterSelect() (which enables users to select parameters from a menu).
Column Name Size in Family Tables
#define PRO_FAMTAB_FIELDNAME_SIZE changes field limit for the family table column name to PRO_PATH_SIZE.
So applications built on and after Creo 11.0.0.0 can work with longer family table columns names.