The following code crashes with an exception at the point where I try to rename the extrusion feature:
CComPtr<ExtrudeDefinition> pExtrudeDef; hRes = pListOfExtrusions->CreateExtrudeDefinition(pProfile,kCutOperation,&pExtrudeDef); pExtrudeDef->SetDistanceExtent(_variant_t(kHeight),kSymmetricExtentDirection); // Add the extrusion. CComPtr<ExtrudeFeature> pExtrude; hRes = pListOfExtrusions->Add (pExtrudeDef,&pExtrude); if (FAILED(hRes) || (pExtrude == nullptr)) { return ReturnAndShowCOMError (hRes,L"ExtrudeSketch but could Add ExtrudeDefinition\n"); } // Crashes here. All is fine if I don't rename the feature with this call... pExtrude->Name = L"EXTRUDED_CIRCLE" ;
The crash seems to happen inside ExtrudeFeature::PutName.
Is it possible to rename an extrusion feature. If so what is the method to do it?
Solved! Go to Solution.
Solved by jdkriek. Go to Solution.
As usual as soon as I post I find the asswer. I should have been using put_Name, not Name, I believe.