Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Renaming an extrusion feature

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
oransen
1109 Views, 2 Replies

Renaming an extrusion feature

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?

2 REPLIES 2
Message 2 of 3
oransen
in reply to: oransen

As usual as soon as I post I find the asswer. I should have been using put_Name, not Name, I believe.

 

Tags (1)
Message 3 of 3
jdkriek
in reply to: oransen


@oransen wrote:

As usual as soon as I post I find the asswer. I should have been using put_Name, not Name, I believe.

 


lol Indeed, and yes that's correct.

Jonathan D. Kriek
MFG Solutions Engineer
KETIV Technologies, Inc.


Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report