Article - CS367218

What is the corresponding replace API for Creo Object Toolkit pfcComponentFeat::CreateReplaceOp() to be used in place of ExecuteFeatureOps with Creo Object Toolkit

Modified: 25-Apr-2022   


Applies To

  • Creo Parametric 7.0 to 9.0

Description

  • What is the corresponding replace API for Creo Object Toolkit 
    pfcComponentFeat::CreateReplaceOp() to be used in place of ExecuteFeatureOps 
pfcCompModelReplace_ptr replaceOp = comp->CreateReplaceOp(compNewModel);
pfcFeatureOperation_ptr replaceFeatureOp = pfcFeatureOperation::cast(replaceOp);
pfcFeatureOperations_ptr cpfcFeatureOperations = new pfcFeatureOperations();
cpfcFeatureOperations->append(replaceFeatureOp);
pfcSession_ptr session = _creoManager->GetSession();
pfcModel_ptr model = session->GetCurrentWindow()->GetModel();
pfcSolid_ptr rootSolid = pfcSolid::cast(model);
try
{
rootSolid->ExecuteFeatureOps(cpfcFeatureOperations); //throws exception with Creo 7
}

 
This is a printer-friendly version of Article 367218 and may be out of date. For the latest version click CS367218