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 Web.Link functions 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 Web.Link assembly functions.
The following figure shows an assembly hierarchy with two examples of the contents of a pfcComponentPath object.
In the assembly shown in the figure, subassembly C is component identifier 11 within assembly A, Part B is component identifier
3 within assembly AB, and so on. The subassembly AB occurs twice. To refer to the two occurrences of part B, use the following:
(?)Component B’ Component B"
ComponentIds.Item(0) = 2 ComponentIds.Item(1) = 11
ComponentIds.Item(1) = 2 ComponentIds.Item(2) = 6
ComponentIds.Item(2) = 5 ComponentIds.Item(3) = 12
ComponentIds.Item(3) = 2 ComponentIds.Item(4) = 3
ComponentIds.Item(4) = 3
The object pfcComponentPath is one of the main portions of the pfcSelection object.
Assembly Components
Methods and Properties Introduced:
|
|
pfcComponentFeat.IsBulkitem |
|
|
pfcComponentFeat.IsSubstitute |
|
|
pfcComponentFeat.CompType |
|
|
pfcComponentFeat.ModelDescr |
|
|
pfcComponentFeat.IsPlaced |
|
|
pfcComponentFeat.IsPackaged |
|
|
pfcComponentFeat.IsUnderconstrained |
|
|
pfcComponentFeat.IsFrozen |
|
|
pfcComponentFeat.Position |
|
|
pfcComponentFeat.CopyTemplateContents() |
|
|
pfcComponentFeat.CreateReplaceOp() |
The property pfcComponentFeat.IsBulkitem 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 property pfcComponentFeat.IsSubstitute 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 property pfcComponentFeat.CompType enables you to set the type of the assembly component. The component type identifies the purpose of the component in a manufacturing
assembly.
The property pfcComponentFeat.ModelDescr returns the model descriptor of the component part or subassembly.
Note
From Pro/ENGINEER Wildfire 4.0 onwards, the property pfcComponentFeat.ModelDescr 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 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 property pfcComponentFeat.IsPlaced 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
property pfcComponentFeat.IsPackaged to determine if the specified component is packaged.
The property pfcComponentFeat.IsUnderconstrained determines if the specified component is underconstrained, that is, it possesses some constraints but is not fully constrained.
The property pfcComponentFeat.IsFrozen 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 property pfcComponentFeat.Position 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 property 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().
Example Code: Replacing Instances
The sample code in the file pfcComponentFeatExamples.js located at <creo_weblink_loadpoint>/weblinkexamples/jscript contains a single static utility method. This method takes an assembly for an argument. It searches through the assembly
for all components that are instances of the model "bolt". It then replaces all such occurrences with a different instance
of bolt.