Assemblies and Components
This section describes the Creo Object TOOLKIT C++ methods that access the methods of a Creo assembly. You must be familiar with the following before you read this section:
•  The Selection Object
•  Coordinate Systems
•  The Geometry section
Structure of Assemblies and Assembly Objects
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.
Image
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 BComponent 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.
Regenerating an Assembly Component
Method Introduced:
The method pfcComponentFeat::Regenerate regenerates an assembly component. The method regenerates the assembly component just as in an interactive Creo session.
Creating a Component Path
Methods Introduced
The method pfcCreateComponentPath returns a component path object, given the Assembly model and the integer id path to the desired component.
Component Path Information
Methods Introduced:
The method pfcComponentPath::GetRoot returns the assembly at the head of the component path object.
The method pfcComponentPath::SetRoot setsthe assembly at the head of the component path object as the root assembly.
The method pfcComponentPath::GetComponentIds returns the sequence of ids which is the path to the particular component.
The method pfcComponentPath::SetComponentIds sets the path from the root assembly to the component through various subassemblies containing this component.
The method pfcComponentPath::GetLeaf returns the solid model at the end of the component path.
The method pfcComponentPath::GetTransform returns the coordinate system transformation between the assembly and the particular component. It has an option to provide the transformation from bottom to top, or from top to bottom. This method describes the current position and the orientation of the assembly component in the root assembly.
The method pfcComponentPath::SetTransform applies a temporary transformation to the assembly component, similar to the transformation that takes place in an exploded state. The transformation will only be applied if the assembly is using DynamicPositioning.
The method pfcComponentPath::GetIsVisible identifies if a particular component is visible in any simplified representation.
The methods wfcSubstituteComponent::GetSubCompPath and wfcSubstituteComponent::GetSubCompFeat return the component path and handle to the component feature of the substituted component.
The method wfcWComponentPath::GetSubstituteComponent returns the component path and handle to the substituted component, when the replacing component is a simplified representation. The method wfcWComponentPath::GetSubstitutionType returns the substitution type of the simplified representation using the enumerated type wfcSubstitutionType:
•  wfcSUBSTITUTE_NONE—Specifies that no substitution type has been defined.
•  wfcSUBSTITUTE_INTERCHG—Specifies that the component is substituted with an interchange assembly component or a family table.
•  wfcSUBSTITUTE_PRT_REP—Specifies that the part is substituted with a simplified representation.
•  wfcSUBSTITUTE_ASM_REP—Specifies that the assembly is substituted with a simplified representation.
•  wfcSUBSTITUTE_ENVELOPE—Specifies that the assembly is substituted with an envelope.
•  wfcSubstitutionType_nilNULL value.
Displayed Entities
Methods Introduced:
The methods in this section return the list of entities, that is, points, coordinate systems, datum curves, and quilts that are currently displayed in an assembly.
Assembling Components
Methods Introduced:
The method pfcAssembly::AssembleComponent adds a specified component model to the assembly at the specified initial position. The position is specified in the format defined by the interface pfcTransform3D. Specify the orientation of the three axes and the position of the origin of the component coordinate system, with respect to the target assembly coordinate system.
Note
If the transform matrix passed as the initial position of the component is incorrect and non-orthonormal, the method pfcAssembly::AssembleComponent returns the error pfcXToolkitBadInputs. In such scenario, you can use the method pfcMakeMatrixOrthonormal to convert this non-orthonormal matrix to an orthonormal matrix.
The method pfcAssembly::AssembleByCopy creates a new component in the specified assembly by copying from the specified component. If no model is specified, then the new component is created empty. The input parameters for this method are:
•  LeaveUnplaced—If true the component is unplaced. If false the component is placed at a default location in the assembly. Unplaced components belong to an assembly without being assembled or packaged. These components appear in the model tree, but not in the graphic window. Unplaced components can be constrained or packaged by selecting them from the model tree for redefinition. When its parent assembly is retrieved into memory, an unplaced component is also retrieved.
•  ModelToCopy—Specify the model to be copied into the assembly
•  NewModelName—Specify a name for the copied model
The method pfcComponentFeat::GetConstraints retrieves the constraints for a given assembly component.
The method pfcComponentFeat::SetConstraints allows you to set the constraints for a specified assembly component. The input parameters for this method are:
•  Constraints—Constraints for the assembly component. These constraints are explained in detail in the later sections.
•  ReferenceAssembly—The path to the owner assembly, if the constraints have external references to other members of the top level assembly. If the constraints are applied only to the assembly component then the value of this parameter should be null.
This method modifies the component feature data and regenerates the assembly component.
The method pfcComponentFeat::GetConstraintsWithCompPath retrieves the constraints for a given assembly component using the input argument CompPath which is the path to the owner assembly. Pass this input argument CompPath, if the constraints have references to other members of the top level assembly. Pass it as Null, if the constraints have references only to the owner assembly.
The method wfcWComponentFeat::RemoveConstraint removes one or all the constraints for the specified assembly component. It takes the index of the constraint as its input argument.
The method wfcWAssembly::AutoInterchange interchanges an assembly component with another component that contains equivalent assembly constraints. The input parameters are:
•  ComponentIDs—Specifies the component identifiers of the replaced members from the assembly nodes.
•  ReplacementModel—Specifies the replacing component, which can be a part or a sub-assembly.
The method wfcWAssembly::CreateAssemblyItem creates an assembly item that defines the flexible components. Refer to the section Flexible Components and Inheritance Features in an Assembly for more information on flexible items.
The method wfcWAssembly::GetConnectors returns the list of connectors defined for the specified assembly.
The method wfcWAssembly::GetHarnesses returns the list of harnesses defined for the specified assembly.
The method wfcWAssembly::GetLinestocks returns the list of linestocks defined for the specified assembly. Use the methods wfcLineStock::GetName and wfcLineStock::SetName to get and set the name of linestock in an assembly.
The method wfcWAssembly::GetSpools returns the list of spools defined for the specified assembly. Use the methods wfcSpool::GetName and wfcSpool::SetName to get and set the name of spool in an assembly.
Use the method wfcWAssembly::ListDisplayedComponents to retrieve a list of all the currently displayed components in a solid.
The methods wfcExternalFeatRefAsmComp::GetPathToOwner and wfcExternalFeatRefAsmComp::SetPathToOwner retrieve and set the path from the external specified reference to the component that owns the specified external reference.
The methods wfcExternalFeatRefAsmComp::GetPathToRef and wfcExternalFeatRefAsmComp::SetPathToRef retrieve and set the path from the external specified reference to the component from which the external reference was created.
The method wfcWExternalFeatureReference::GetAsmcomponents retrieves from the specified external reference a path to the component from which the reference was created. It also returns a path to the component that owns the specified external reference.
The method wfcWExternalFeatureReference::GetFeature retrieves from the specified external reference a feature referred to by the external reference.
Constraint Attributes
Methods Introduced:
The method pfcConstraintAttributes::Create returns the constraint attributes object based on the values of the following input parameters:
•  Ignore—Constraint is ignored during regeneration. Use this capability to store extra constraints on the component, which allows you to quickly toggle between different constraints.
•  Force—Constraint has to be forced for line and point alignment.
•  None—No constraint attributes. This is the default value.
Use the Get methods to retrieve the values of the input parameters specified above and the Set methods to modify the values of these input parameters.
Assembling a Component Parametrically
You can position a component relative to its neighbors (components or assembly features) so that its position is updated as its neighbors move or change. This is called parametric assembly. Creo allows you to specify constraints to determine how and where the component relates to the assembly. You can add as many constraints as you need to make sure that the assembly meets the design intent.
Methods Introduced:
The method pfcComponentConstraint::Create returns the component constraint object having the following parameters:
•  ComponentConstraintType—Using the TYPE options, you can specify the placement constraint types. They are as follows:
  pfcASM_CONSTRAINT_MATE—Use this option to make two surfaces touch one another, that is coincident and facing each other.
  pfcASM_CONSTRAINT_MATE_OFF—Use this option to make two planar surfaces parallel and facing each other.
  pfcASM_CONSTRAINT_ALIGN—Use this option to make two planes coplanar, two axes coaxial and two points coincident. You can also align revolved surfaces or edges.
  pfcASM_CONSTRAINT_ALIGN_OFF—Use this option to align two planar surfaces at an offset.
  pfcASM_CONSTRAINT_INSERT—Use this option to insert a "male" revolved surface into a ``female'' revolved surface, making their respective axes coaxial.
  pfcASM_CONSTRAINT_ORIENT—Use this option to make two planar surfaces to be parallel in the same direction.
  pfcASM_CONSTRAINT_CSYS—Use this option to place a component in an assembly by aligning the coordinate system of the component with the coordinate system of the assembly.
  pfcASM_CONSTRAINT_TANGENT—Use this option to control the contact of two surfaces at their tangents.
  pfcASM_CONSTRAINT_PNT_ON_SRF—Use this option to control the contact of a surface with a point.
  pfcASM_CONSTRAINT_EDGE_ON_SRF—Use this option to control the contact of a surface with a straight edge.
  pfcASM_CONSTRAINT_DEF_PLACEMENT—Use this option to align the default coordinate system of the component to the default coordinate system of the assembly.
  pfcASM_CONSTRAINT_SUBSTITUTE—Use this option in simplified representations when a component has been substituted with some other model
  pfcASM_CONSTRAINT_PNT_ON_LINE—Use this option to control the contact of a line with a point.
  pfcASM_CONSTRAINT_FIX—Use this option to force the component to remain in its current packaged position.
  pfcASM_CONSTRAINT_AUTO—Use this option in the user interface to allow an automatic choice of constraint type based upon the references.
  pfcASM_CONSTRAINT_EXPLICIT
•  AssemblyReference—A reference in the assembly.
•  AssemblyDatumSide—Orientation of the assembly. This can have the following values:
  Yellow—The primary side of the datum plane which is the default direction of the arrow.
  Red—The secondary side of the datum plane which is the direction opposite to that of the arrow.
•  ComponentReference—A reference on the placed component.
•  ComponentDatumSide—Orientation of the assembly component. This can have the following values:
  Yellow—The primary side of the datum plane which is the default direction of the arrow.
  Red—The secondary side of the datum plane which is the direction opposite to that of the arrow.
•  Offset—The mate or align offset value from the reference.
•  Attributes—Constraint attributes for a given constraint.
•  UserDefinedData—A string that specifies user data for the given constraint.
Use the Get methods to retrieve the values of the input parameters specified above and the Set methods to modify the values of these input parameters.
Redefining and Rerouting Assembly Components
These methods enable you to reroute previously assembled components, just as in an interactive Creo session.
Methods Introduced:
The method pfcComponentFeat::RedefineThroughUI must be used in interactive Creo Object TOOLKIT C++ applications. This method displays the dialog box for constraints. This enables the end user to redefine the constraints interactively. The control returns to Creo Object TOOLKIT C++ application when the user selects OK or Cancel and the dialog box is closed.
The method pfcComponentFeat::MoveThroughUI invokes a dialog box that prompts the user to interactively reposition the components. This interface enables the user to specify the translation and rotation values. The control returns to Creo Object TOOLKIT C++ application when the user selects OK or Cancel and the dialog box is closed.
Exploded Assemblies
These methods enable you to determine and change the explode status of the assembly object.
Methods Introduced:
The methods pfcAssembly::Explode and pfcAssembly::UnExplode enable you to determine and change the explode status of the assembly object.
The method pfcAssembly::GetIsExploded reports whether the specified assembly is currently exploded. Use this method in the assembly mode only. The exploded status of an assembly depends on the mode. If an assembly is opened in the drawing mode, the state of the assembly in the drawing view is displayed. The drawing view does not represent the actual exploded state of the assembly.
The method pfcAssembly::GetActiveExplodedState returns the current active explode state.
The method pfcAssembly::GetDefaultExplodedState returns the default explode state.
The method pfcExplodedState::Activate activates the specified explode state representation.
Accessing Exploded States
Methods Introduced:
The methods wfcWAssembly::GetExplodeStateFromName and wfcWAssembly::GetExplodeStateFromId return the exploded state representation of a solid with the specified name and ID respectively.
The method wfcWAssembly::SelectExplodedState enables you to select a specific exploded state from the list of defined exploded states.
The method wfcWExplodedState::GetExplodedStateName returns the name of the exploded state. Use the method wfcWExplodedState::SetExplodedStateName to set the name of the exploded state.
The method wfcWExplodedState::GetExplodedcomponents returns an array of assembly component paths that are included in the exploded state.
The method wfcWExplodedState::GetExplodedStateMoves retrieves an array of moves for the specified exploded state. The sequence of moves defines the exploded position of an assembly component or a set of assembly components. For example, you can move an assembly component over the X-axis, rotate it over a selected edge, and then move over the Y-axis. The final position of the assembly component is attained by performing these three moves. Use the method wfcWExplodedState::SetExplodedStateMoves to set the array of moves of an exploded state.
The method wfcExplodedAnimationMoveInstruction::Create creates a wfcExplodedAnimationMoveInstruction data object that contains information about the moves of an exploded state.
The method wfcExplodedAnimationMoveInstruction::GetCompSet returns an array that contains the full path to the assembly component. Use the method wfcExplodedAnimationMoveInstruction::SetCompSet to set an array of paths to the assembly components.
The methods wfcExplodedAnimationMoveInstruction::GetMove and wfcExplodedAnimationMoveInstruction::SetMove retrieve and set the move of the exploded state.
The method wfcExplodedAnimationMove::Create creates the wfcExplodedAnimationMove data object.
The method wfcExplodedAnimationMove::GetMoveType returns the type of move for the exploded state. The move can have one of the following values:
•  wfcEXPLDANIM_MOVE_TRANSLATE
•  wfcEXPLDANIM_MOVE_ROTATE
Use the method wfcExplodedAnimationMove::SetMoveType to set the move type using the enumerated type wfcExplodedAnimationMoveType.
The methods wfcExplodedAnimationMove::GetStartPoint and wfcExplodedAnimationMove::SetStartPoint get and set the start location of the transitional direction or the rotational axis, depending upon the selected move type.
The methods wfcExplodedAnimationMove::GetDirVector and wfcExplodedAnimationMove::SetDirVector get and set the direction vector for the transitional direction or the rotational axis, depending upon the selected move type.
Depending upon the selected move type, the methods wfcExplodedAnimationMove::GetValue and wfcExplodedAnimationMove::SetValue get and set the translational distance or the rotation angle.
Manipulating Exploded States
Methods Introduced:
The method wfcWAssembly::CreateExplodedState creates a new exploded state based on the values of the following input arguments:
•  name—Specifies the name of the exploded state. This argument cannot be NULL.
•  AnimMoveInstructions—Specifies an array of wfcExplodedAnimationMoveInstruction objects.
Use the method wfcWAssembly::DeleteExplodedState to delete a specified exploded state.
Skeleton Models
Skeleton models are a 3-dimensional layout of the assembly. These models are holders or distributors of critical design information, and can represent space requirements, important mounting locations, and motion.
Methods Introduced:
The method pfcAssembly::AssembleSkeleton adds an existing skeleton model to the specified assembly.
The method pfcAssembly::GetSkeleton returns the skeleton model of the specified assembly.
The method pfcAssembly::DeleteSkeleton deletes a skeleton model component from the specified assembly.
The method pfcAssembly::AssembleSkeletonByCopy adds a specified skeleton model to the assembly. The input parameters for this method are:
•  SkeletonToCopy—Specify the skeleton model to be copied into the assembly
•  NewSkeletonName—Specify a name for the copied skeleton model
The method pfcSolid::GetIsSkeleton determines if the specified part model is a skeleton model or a concept model. It returns a true if the model is a skeleton else it returns a false.
Flexible Components and Inheritance Features in an Assembly
A flexible component allows variance of items such as features, dimensions, annotations, and parameters of a model in the context of an assembly. The methods in this section describe the properties for the flexible component.
An Inheritance feature allows one-way associative propagation of geometry and feature data from a reference part to target part within an assembly. The reference part is the original part and the target part contains the inheritance features. Inheritance features are always created by referencing existing parts. An inheritance feature begins with all of its geometry and data identical to the reference part from which it is derived.
Use inheritance features or flexible components to create variations of a model in an assembly. This section refers collectively to inheritance features and flexible components as "variant features".
Methods Introduced:
The method wfcWComponentFeat::CreateFlexibleModel creates a flexible model from the specified flexible model component.
The method wfcWComponentFeat::CreatePredefinedFlexibilityComponent converts the specified assembly component to a flexible component. It uses the variant items with predefined flexibility to create the flexible component.
Use the method wfcWComponentFeat::IsFlexible to identify if the specified assembly component is a flexible component. If the method returns true, the component is a flexible component.
The method wfcWComponentFeat::SetAsFlexible converts a specified assembly component to a flexible component by using the variant items specified in the input argument.
The method wfcWComponentFeat::UnsetAsFlexible converts a flexible component to a regular component.
Variant Feature Model
Method Introduced:
The method wfcWModel::IsVariantFeatModel returns a boolean to identify if a model pointer is from an inheritance feature or a flexible component. The method returns true, if the model pointer is from an inheritance feature, else it returns false.
Variant Items for Flexible Components
Varied items define component flexibility. You define components, dimensions, features, parameters, references, gtols, and so on in the original part. The methods described in this section enable you to assign values to the varied items to define component flexibility in the assembly
Methods Introduced:
The method wfcAssemblyItemInstructions::Create creates a new instance of the object wfcAssemblyItemInstruction that contains the instructions to define a variant item for a flexible component. Specify the model owner, item type, and item ID as input arguments of this method. The input arguments are:
•  ItemOwner— Specifies the model owner of the item or parameter.
•  ItemType— Specifies the item type. The value of this argument is ignored for parameter. For parameter, pass this value as pfcModelItemType_nil.
•  ItemId— Specifies the item identifier.
•  ItemName— Specifies the parameter name.
The method wfcAssemblyItemInstructions::GetItemOwner gets the name of the model owner for the specified variant item or parameter.
The method wfcAssemblyItemInstructions::SetItemCompPath gets the component path for the variant item. Use the method wfcAssemblyItemInstructions::SetItemCompPath to set the component path for the variant item.
The methods wfcAssemblyItemInstructions::GetItemId and wfcAssemblyItemInstructions::SetItemId get and set the identifier for the variant item or parameter.
The methods wfcAssemblyItemInstructions::GetItemName and wfcAssemblyItemInstructions::SetItemName get and set the name of the variant parameter.
The methods wfcAssemblyItemInstructions::GetItemType and wfcAssemblyItemInstructions::SetItemType get and set the type of variant item using the enumerated type pfcModelItemType. This value is not required for variant parameter. If the object is a variant parameter, pass this value as pfcModelItemType_nil.
The method wfcWFeature::ListVariedItems lists the variant items, that is dimensions, features, and annotations owned by an inheritance feature or flexible component.
The method wfcWFeature::ListVariedParameters lists the variant parameters owned by an inheritance feature or flexible component.
Gathering Components by Rule
Creo application provides tools to search for components within large assemblies. This section describes how to access some of the functionality through Creo Object TOOLKIT C++.
You can specify different types of rules to search and generate a list of components that follow these rules. You can gather components using one or more of the following rules:
•  By model name
•  By parameters, using an expression
•  By location with a zone
•  By distance from a point
•  By size
•  By an existing simplified representation
Use the method wfcAssemblyRule::GetRuleType to get the type of rule that was used to search for the component. The types of rules are:
•  wfcRULE_NONESpecifies that no rule has been set.
•  wfcRULE_NAME—Specifies the rule to search components by model name.
•  wfcRULE_EXPR—Specifies the rule to search components by parameters, using an expression.
•  wfcRULE_ZONE—Specifies the rule to search components by location with a zone.
•  wfcRULE_DIST—Specifies the rule to search components by distance from a point.
•  wfcRULE_SIZE—Specifies the rule to search components by size.
•  wfcRULE_SIMP_REP—Specifies the rule to search components by an existing simplified representation.
Gathering Components by Model Name
The class wfcAssemblyNameRule specifies the rule to gather components by model name. This class is an interface that can be used to define the name rule and contains the methods described below:
Use the method wfcAssemblyNameRule::Create to create a rule to search for components by name. Specify the search string as the input parameter NameMask for this method. Use wildcards to improve the search results.
•  Use the method wfcAssemblyNameRule::SetNameMask to set the search string for the name rule.
•  Use the method wfcAssemblyNameRule::GetNameMask to get the search string used in the name rule.
Note
The attribute 'NameMask' can be a wildcard character that is, you can specify wildcard characters for object names, their extensions, and directory names. For more information, refer to the online Help.
Gathering Components by Size
The class wfcAssemblySizeRule is an interface that can be used to define the rule to gather components by their size.
Use the method wfcAssemblySizeRule::Create to create a rule to search for components by size. The input parameters of this method are as follows:
•  Absolute—If set to true, compares the absolute size of the model with respect to the assembly, else compares the relative size of the model with respect to the assembly.
•  GreaterThan—If set to true, searches for components that are larger than the specified size, else searches for components that are smaller.
•  IncludeDatums—If set to true, gather the model volume using the bounding box, else use the regeneration outline to gather the model volume.
•  Value—Specifies the actual size against which the size of the model will be compared.
Use the methods wfcAssemblySizeRule::SetAbsolute and wfcAssemblySizeRule::GetAbsolute to set and get the absolute or relative size of the model respectively. Set the value of the input parameter to true, to compare the absolute size of the model with the size of the top-level assembly. Specify false, to compare the relative size of the model with respect to the assembly. For the relative size, specify a value in the range of 0.0 to 1.0. The method compares the component size to that of the top-level assembly and uses this ratio to determine whether the component should be gathered.
Use the methods wfcAssemblySizeRule::SetGreaterThan and wfcAssemblySizeRule::GetGreaterThan to set and get the absolute or relative size of the model respectively. To search for components greater than the specified size, set the parameter GreaterThan to true. If you set the parameter to false, the method gathers the components that are smaller than the specified size.
Use the methods wfcAssemblySizeRule::SetIncludeDatums and wfcAssemblySizeRule::GetIncludeDatums to set and get the model size using the bounding box or regeneration outline. Specify the value true to use bounding box, or false for regeneration outline.
Use the methods wfcAssemblySizeRule::SetValue and wfcAssemblySizeRule::GetValue to set the get the size against which the specified model will be compared. The valid range for this parameter is from 0.0 to 1.0 only if the Absolute attribute is set to false.
Gathering Components by Simplified Representation
The class wfcAssemblySimpRepRule specifies the rule to gather components that belong to the specified simplified representation. This class is an interface that can be used to define the simplified representation rule and contains the methods described below:
Use the method wfcAssemblySimpRepRule::Create to create a rule to search for components by simplified representation.
Use the methods wfcAssemblySimpRepRule::GetRuleSimpRep and wfcAssemblySimpRepRule::SetRuleSimpRep to get and set the simplified representation to be used for the rule.
Gathering Components by Parameters
The class wfcAssemblyExpressionRule specifies the rule to gather components by parameter. This class is an interface that can be used to define the parameter rule and contains the methods described below:
Use the method wfcAssemblyExpressionRule::Create to create a rule to search for components by parameter expressions. The parameter of this method is given below:
•  Expressions—Specifies the expression created using the parameters and logical operators.
Use the methods wfcAssemblyExpressionRule::GetExpressions and wfcAssemblyExpressionRule::SetExpressions to get and set the parameter expressions. You can specify an expression in the relations format to search for components of a particular parameter value. For example, consider the following expression:
type == "electrical" | cost <= 10
When you supply this expression to the rule, it searches for components that have a “cost” parameter of less than or equal to 10, or for components whose type parameter is set to “electrical.”
Gathering Components by Zone
The class wfcAssemblyZoneRule specifies the rule to gather components by the specified zone feature. This class is an interface that can be used to define the zone rule and contains the methods described below:
Use the method wfcAssemblyZoneRule::Create to create a rule to search for components by the zone feature. The parameter of this method is given below:
•  ZoneFeature—Gathers all the components that belong to the specified zone feature.
Use the methods wfcAssemblyZoneRule::GetZoneFeature and wfcAssemblyZoneRule::SetZoneFeature to get and set the zone feature. When you create a zone, the method creates a zone feature in the top-level assembly.
Gathering Components by Distance from a Point
The class wfcAssemblyDistanceRule specifies the rule to gather components within specified distance from a point. This class is an interface that can be used to define the distance rule and contains the methods described below:
Use the method wfcAssemblyDistanceRule::Create to create a rule to search for components within specified distance. The parameters of this method are given below:
•  Center—Specifies the centre point of the specified region.
•  Distance—Specifies the distance from center point.
•  IncludeDatums—Specifies the type of datum to be included.
Use the methods wfcAssemblyDistanceRule::GetCenter and wfcAssemblyDistanceRule::SetCenter to get and set the center point from which the distance is measured.
Use the method wfcAssemblyDistanceRule::GetDistance to get the distance against which the components will be gathered. The method wfcAssemblyDistanceRule::SetDistance sets the distance from the centre point of the model.
Use the methods wfcAssemblyDistanceRule::GetIncludeDatums and wfcAssemblyDistanceRule::SetIncludeDatums to set and get the model size respectively. If set to true, gather the model volume using the bounding box, else use the regeneration outline to gather the model volume.
Listing Components By Rule
Use the method wfcWAssembly::ListComponentsByAssemblyRule to list all the components that satisfy the specified rule. The input parameter for this method is:
•  AsmRule —Specify the rule, against which the components will be searched.