Usage: you must use this class as is. You should never derive it.
public class CATAdpDuplicator
Class to duplicate (clone) elements.
Role:
This class duplicates elements passed as input if they are clonable. In IRPC, only references and representations can be passed as input.
A cloning scope is calculated dynamically. The following component may be duplicated (and returned in the result set) if aggregated under a given reference, even if not* specified in input :
If defined, the relevant PLMIdentificationInitialization business logic with 'Cloning' OperationId will be called on every impacted reference or representation. If not defined a default logic is applied by adding the given IdCloningString to the first string attribute of the identifier set (most of the time the attirbute PLM_ExternalID).
If a specific attribute set is associated to a given component, those attributes will applied after the attributes defined by the previous business logic. It may overwrite some of them.
Example of usage :CATAdpDuplicator duplicator; while(Then :) { CATAdpAttributeSet attributeSet; // Code which specifies attributes to change, like attributes in the identificator set // ... if(FAILED(duplicator.AddElement(pMyComp, attributeSet)) //Error management }
if(FAILED(duplicator.Duplicate())
{
CATIAdpPLMErrorReviewer pErrorReviewer = NULL;
duplicator.GetErrorReviewer(pErrorReviewer);
//manage errors
CATSysReleasePtr(pErrorReviewer);
}
Or :
CATAdpComponentsAssociation duplicatedComponents;
if(SUCCEEDED(duplicator.Duplicate(duplicatedComponents))
{
CATAdpComponentsAssociationIter iter(duplicatedComponents.GetIterator());
CATIAdpPLMIdentificator *pSource, *pDuplicated = NULL;
while(S_OK == iter.NextComponent(pSource, pDuplicated))
{
//Do something
CATSysReleasePtr(pSource);
CATSysReleasePtr(pDuplicated);
}
}
else
{
CATIAdpPLMErrorReviewer *pErrorReviewer = NULL;
duplicator.GetErrorReviewer(pErrorReviewer);
//manage errors
CATSysReleasePtr(pErrorReviewer);
}
| public CATAdpDuplicator( | iopErrorReviewer | = NULL) |
| public CATAdpDuplicator( | const | iIdCloningString, | |
| iopErrorReviewer | = NULL) |
| public virtual ~CATAdpDuplicator( | ) |
| public AddElement( | ipAdpIdentificator) |
S_OK Operation succeeded E_FAIL Error were encountered, no duplication done. See error reviewer content to fetch errors details. Nothing was done during the operationE_UNEXPECTED Error were encountered, no duplication done. See error reviewer content to fetch errors details. Nothing was done during the operation| public AddElement( | ipAdpIdentificator, | |
| const | iAdpAttributeSet) |
S_OK Operation succeeded E_FAIL Error were encountered, no duplication done. See error reviewer content to fetch errors details. Nothing was done during the operationE_UNEXPECTED Error were encountered, no duplication done. See error reviewer content to fetch errors details. Nothing was done during the operation| public Duplicate( | ) |
S_OK Operation succeeded E_FAIL Error were encountered, no duplication done. See error reviewer content to fetch errors details. Nothing was done during the operationE_UNEXPECTED Error were encountered, no duplication done. See error reviewer content to fetch errors details. Nothing was done during the operation| public Duplicate( | oComponentsAssociation) |
S_OK Operation succeeded E_FAIL Error were encountered, no duplication done. See error reviewer content to fetch errors details. Nothing was done during the operationE_UNEXPECTED Error were encountered, no duplication done. See error reviewer content to fetch errors details. Nothing was done during the operation| public GetErrorReviewer( | oErrorReviewer) |
Copyright © 1999-2014, Dassault Systèmes. All rights reserved.