User's Guide > Assembly: Assembling Components > Assembling Components by Functions
Assembling Components by Functions
 
This section describes how to use the concepts of feature creation to assemble components into an assembly. Read the section Element Trees: Principles of Feature Creation before this section.
Functions Introduced:
ProAsmcompMdlnameCreateCopy()
ProAsmcompAssemble()
ProAsmcompPositionGet()
ProAsmcompPositionSet()
ProAsmcompConstraintsWithComppathGet()
ProAsmcompConstraintsSet()
ProAsmcompAllConstrRemove()
ProAsmcompConstrRemove()
ProAsmcompRegenerate()
Superseded Function:
ProAsmcompConstraintsWithDtmOrientGet()
Use the function ProAsmcompMdlnameCreateCopy() to create a new component in the assembly by copying from an existing model. Specify the handle to the model to be used as a template for the copy. If a model is not specified, a component that does not have initial geometry is created. The function provides the ProAsmcomp handle to the new component.
The function ProAsmcompAssemble() assembles a component to the assembly or sub-assembly using the parametric constraints available when assembling a component in Creo Parametric. The initial position of the component is a ProMatrix object. 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. The function provides the ProAsmcomp feature handle to the newly created assembly.
Note:
 
If the transform matrix passed as the initial position of the component is incorrect and non-orthonormal, the function ProAsmcompAssemble() returns the error PRO_TK_BAD_INPUTS. In such scenario, you can use the function ProMatrixMakeOrthonormal() to convert this non-orthonormal matrix to an orthonormal matrix.
The function ProAsmcompPositionGet() retrieves the component's initial position before constraint are applied.
The function ProAsmcompPositionSet() specifies the initial position of the component before constraints are applied. This affects the position of the component only if the component is packaged or underconstrained.
The function ProAsmcompConstraintsWithDtmOrientGet() is deprecated in Creo Parametric 7.0.0.0. Use the function ProAsmcompConstraintsWithComppathGet() instead. The function retrieves the specified constraints for the given assembly component and component path. The orientation of the constraints is returned as a value of enumerated data type ProDatumside. The input argument component_path is the path to the owner assembly only if the constraints have references to the other members of the top-level assembly. If the constraints have references only to the owner assembly, then you need to pass this as Null.
The function ProAsmcompConstraintsSet() sets an array of constraints for a given assembly component. This function modifies the component feature data and regenerates the assembly component.
The function ProAsmcompAllConstrRemove() removes all types of constraints including interface constraints for the specified assembly component. Specify a a ProAsmcomp handle to the assembly component in the input argument p_feat_handle.
The function ProAsmcompConstrRemove() removes one or all constraints for the specified assembly component. However, the function does not remove the interface constraint. The input arguments are as follows:
p_feat_handle—Specifies a ProAsmcomp handle to the assembly component.
index—Specifies the constraint index. Pass the value as –1 to remove all the constraints. Use the function ProAsmcompConstraintGet() to determine the index of a particular constraint.
The function ProAsmcompRegenerate() regenerates the placement instructions for an assembly component, given the component handle. The function regenerates the placement instructions just as in an interactive Creo Parametric session. Alternatively, you can use the visit functionality to regenerate recursively some or all of the components in the assembly.
這是否有幫助?