Category Assembly, Object ProAsmcomp

Function ProAsmcompMdlnameCreateCopy


Description
Create a new component in the specified assembly by copying from the specified model. If no model is specified, the new component is created empty. This function either places the new component at a default location in the assembly or leaves it unplaced. This function also initializes the component handle. Note: In Creo 3 this function does not support names longer than 31 characters. It will return PRO_TK_LINE_TOO_LONG for longer names. The support for ProMdlName will be added in a future release.
Replacement in Object TOOLKIT: pfcAssembly::AssembleByCopy
Synopsis
#include <ProAsmcomp.h>
ProErrorProAsmcompMdlnameCreateCopy(
ProAssembly assembly
/* (In)
The specified assembly.
*/
ProMdlName comp_name
/* (In)
The new component name.
*/
ProMdlType comp_type
/* (In)
The new component type; must be either PRO_MDL_ASSEMBLY or PRO_MDL_PART.
*/
ProMdl template_model
/* (In)
Handle to model to be used as a template. If NULL, empty component will be created.
*/
ProBoolean leave_unplaced
/* (In)
If PRO_B_TRUE, the component is left unplaced. If PRO_B_FALSE, the component is placed by default.
*/
ProAsmcomp* p_comp_handle
/* (Out)
Handle to the new component to be initialized.
*/
)
Returns
PRO_TK_NO_ERRORComponent add was successful.
PRO_TK_BAD_INPUTSInvalid name or type for assembly handle or component; or invalid template handle.
PRO_TK_INVALID_TYPETemplate type does not correspond to component type.
PRO_TK_ABORTThe model can not be used as a template or has external dependencies. Copy is aborted.
PRO_TK_GENERAL_ERRORComponent creation failed.
PRO_TK_NOT_VALIDRequired license not found.
PRO_TK_LINE_TOO_LONGcomp_name length of the new component is more than 31 chars. This restriction will be removed in future releases.
PRO_TK_UNSUPPORTEDUnsupported model. For instance, models which come from Multi-CAD model approach, are not supported in this release.

Manual References:

  1. Assembly: Assembling Components: Assembling Components by Functions
  2. Assembly: Assembling Components: Assembling Components by Functions
  3. Assembly: Top-down Design: Assembly Component Functions
  4. Assembly: Top-down Design: Assembly Component Functions
  5. Working with Multi-CAD Models Using Creo Unite: Functions that Support Multi-CAD Assemblies
  6. Working with Multi-CAD Models Using Creo Unite: Superseded Functions
  7. Working with Multi-CAD Models Using Creo Unite: Restrictions on Character Length for Multi-CAD Functions

Sample Code References:

  1. pt_examples ( TestSkelet.c )