Extrude display wrong after parent sketch has been modified

Extrude display wrong after parent sketch has been modified

PierreMJ
Explorer Explorer
188 Views
0 Replies
Message 1 of 1

Extrude display wrong after parent sketch has been modified

PierreMJ
Explorer
Explorer

Hi there,
I wrote a program that adds chamfers on the corners of a closed polyline in an existing sketch. Works well, however, the child extrude does not get properly updated, respectively it displays as a mix of the previous geometry and the new one.

Start geometry:

StartSituation.png

 

My program (simplified):

 

...

//bring chamfer into sketch using API: 
auto line = sketchToModify->NativeSketch()->sketchCurves()->sketchLines()->addDistanceChamfer(lineToCut1, line1ExtremityToKeep, lineToCut2, line2ExtremityToKeep, cuttingLength, cuttingLength); 

//After sketch modifications, I update the profile of the child extrude: 
auto newProfile = m_sketch->NativeSketch()->profiles()->item(0);
extrudeChild->NativeExtrudeFeature()->profile(newProfile );

 

 

What I get after execution:

AfterChamfersIntegration.png

I created in that example a chamfer in the sketch at all 4 corners. By 3 of them the extrude looks afterward all right, by the 4th (top left), the extrude body contains somehow the old and the new geometry.

Manually  editing the extrude object and remove / bring back the new profile doesn't help.

 

If I save the model, close it and reopen it, it then displays all right:

Expected.png

 

Any idea, what is going wrong?

0 Likes
189 Views
0 Replies
Replies (0)