The object pfcAssembly is an instance of pfcSolid. The pfcAssembly object can therefore be used as input to any of the pfcSolid and pfcModel methods applicable to assemblies. However assemblies do not contain solid geometry items. The only geometry in the assembly
is datums (points, planes, axes, coordinate systems, curves, and surfaces). Therefore solid assembly features such as holes
and slots will not contain active surfaces or edges in the assembly model.
The solid geometry of an assembly is contained in its components. A component is a feature of type pfcComponentFeat, which is a reference to a part or another assembly, and a set of parametric constraints for determining its geometrical
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.
The important Creo Object
TOOLKIT C++ methods for assemblies are those that operate on the components of an assembly. The object pfcComponentFeat, which is an instance of pfcFeature 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 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 sufficient to have
the integer identifier of the item and the handle to its owning part or assembly, as would be provided by its pfcFeature 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. This is the purpose of the object pfcComponentPath, which is used as the input to Creo Object
TOOLKIT C++ assembly methods.
The following figure shows an assembly hierarchy with two examples of the contents of a pfcComponentPath object.
In the assembly shown in the figure, sub-assembly C is component identifier 11 within assembly A, Part B is component identifier
3 within assembly AB, and so on. The sub-assembly AB occurs twice. To refer to the two occurrences of part B, use the following:
(?)Component B’ Component B"
ComponentIds->get(0) will return 2 ComponentIds->get(1) will return 11
ComponentIds->get(1) will return 2 ComponentIds->get(2) will return 6
ComponentIds->get(2) will return 5 ComponentIds->get(3) will return 12
ComponentIds->get(3) will return 2 ComponentIds->get(4) will return 3
ComponentIds->get(4) will return 3
The object pfcComponentPath is one of the main portions of the pfcSelection object.
Assembly Components
Methods Introduced:
The method pfcComponentFeat::GetIsBulkitem identifies whether an assembly component is a bulk item. A bulk item is a non-geometric assembly feature that should appear
in an assembly bill of materials.
The method pfcComponentFeat::GetIsSubstitute returns a true value if the component is substituted, else it returns a false. When you substitute a component in a simplified
representation, you temporarily exclude the substituted component and superimpose the substituting component in its place.
The method pfcComponentFeat::GetCompType returns the type of the assembly component.
The method pfcComponentFeat::SetCompType enables you to set the type of the assembly component. The component type identifies the purpose of the component in a manufacturing
assembly.
The method pfcComponentFeat::GetModelDescr returns the model descriptor of the component part or sub-assembly.
Note
The method pfcComponentFeat::GetModelDescr throws an exception pfcXtoolkitCantOpen if called on an assembly component whose immediate generic is not in session. Handle this exception and typecast the assembly
component as pfcSolid, which in turn can be typecast as pfcFamilyMember, and use the method pfcFamilyMember::GetImmediateGenericInfo to get the model descriptor of 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.
The method pfcComponentFeat::GetIsPlaced determines whether the component is placed.
The method pfcComponentFeat::SetIsPlaced forces the component to be considered placed. The value of this parameter is important in assembly Bill of Materials.
Note
Once a component is constrained or packaged, it cannot be made unplaced again.
A component of an assembly that is either partially constrained or unconstrained is known as a packaged component. Use the
method pfcComponentFeat::GetIsPackaged to determine if the specified component is packaged.
The method pfcComponentFeat::GetIsUnderconstrained determines if the specified component is underconstrained, that is, it possesses some constraints but is not fully constrained.
The method pfcComponentFeat::GetIsFrozen determines if the specified component is frozen. The frozen component behaves similar to the packaged component and does
not follow the constraints that you specify.
The method pfcComponentFeat::GetPosition retrieves the component’s initial position before constraints and movements have been applied. If the component is packaged
this position is the same as the constraint’s actual position. This method modifies the assembly component data but does not
regenerate the assembly component. To regenerate the component, use the method pfcComponentFeat::Regenerate.
The method pfcComponentFeat::CopyTemplateContents copies the template model into the model of the specified component.
The method pfcComponentFeat::CreateReplaceOp creates a replacement operation used to swap a component automatically with a related component. The replacement operation
can be used as an argument to pfcSolid::ExecuteFeatureOps.
The method wfcWComponentFeat::MakeUniqueSubAssembly creates a unique instance of the sub-assembly by specifying the path to the sub-assembly. Use the method wfcWComponentFeat::RemoveUniqueSubAssembly to remove the instance of the sub-assembly.
Use the method wfcWComponentFeat::IsUnplaced checks if the specified component is unplaced. Unplaced components belong to an assembly without being assembled or packaged.
If the method returns true, the component is unplaced.