The object
ProAssembly is an instance of
ProSolid and shares the same declaration. The
ProAssembly object can therefore be used as input to any of the
ProSolid and
ProMdl functions applicable to assemblies. In particular, because you can use the function
ProSolidFeatVisit() to traverse features, you can extract the assembly datum features and their geometry in the same way as for parts (described
in detail in the
section on
Core: 3D Geometry).
However, assemblies do not contain active geometry items other than those in datums—that is, no “solid” geometry as described
in the
Core: 3D Geometry and
Element Trees: Principles of Feature Creation sections. Therefore, the function
ProSolidBodySurfaceVisit() will not find any surfaces, and solid assembly features such as holes and slots will not contain active surfaces or edges.
The solid geometry of an assembly is contained entirely in its components. Each component is a feature of type PRO_FEAT_COMPONENT, which is a reference to a part or another assembly, plus a set of parametric constraints for determining its geometric location
within the parent assembly.
Assembly features that are solid, such as holes and slots, and therefore affect the solid geometry of parts in the assembly
hierarchy, do not themselves contain the geometry items that describe those modifications. These items are always contained
in the parts whose geometry is modified, within local features created for that purpose of type PRO_FEAT_ASSEM_CUT.
The most important Creo TOOLKIT functions for assemblies are those that operate on the components of an assembly. The object ProAsmcomp, which is an instance of ProFeature and shares its DHandle declaration, is defined for that purpose. Each assembly component is treated as a variety of feature,
and the integer identifier of the component is also the feature identifier.
An assembly component can be another assembly. In general, therefore, an assembly can contain a hierarchy of assemblies and
parts at many levels, in which some assemblies and parts may appear more than once. To identify the role of any database item
in the context of the root assembly, it is not enough to have the integer identifier of the item and the handle to its owning
part or assembly, as would be provided by its ProFeature or ProGeomitem description. It is also necessary to give the full path of the assembly-component references down from the root assembly
to the part or assembly that owns the database item. The object ProAsmcomppath, which is used as the input to Creo TOOLKIT assembly functions, accomplishes this purpose.
The declaration of ProAsmcomppath is as follows:
typedef struct pro_comp_path
{
ProSolid owner;
ProIdTable comp_id_table;
int table_num;
} ProAsmcomppath;
The data structure fields are as follows:
|
• |
owner—Identifies the root assembly |
|
• |
comp_id_table (the component identifier table)—An integer array that contains the identifiers of the components that form the path from
the root assembly down to the component part or assembly being referred to |
|
• |
table_num—Specifies the number of component identifiers in the comp_id_table array |
The following figure
Sample Assembly Hierarchy shows an assembly hierarchy with two examples of the contents of a
ProAsmcomppath object.
Sample Assembly Hierarchy
In the assembly shown in Figure 12-1,
Sample Assembly Hierarchy subassembly C is component identifier 11 within assembly A, Part B is component identifier 3 within assembly AB, and s on.
The subassembly AB occurs twice. To refer to the two occurrnces of part B, use the following:
Component B’ Component B"
table_num = 5 table_num = 4
comp_id_tab[0] = 2 comp_id_tab[0] = 11
comp_id_tab[1] = 2 comp_id_tab[1] = 6
comp_id_tab[2] = 5 comp_id_tab[2] = 12
comp_id_tab[3] = 2 comp_id_tab[3] = 3
comp_id_tab[4] = 3
A ProAsmcomppath structure in which table_num is set to 1 contains the same information as a ProAsmcomp object.
The object
ProAsmcomppath is one of the main ingredients in the
ProSelection object, as described in
The Selection Object.