AnsweredAssumed Answered

Change a contour defining a feature

Question asked by James Hall on Nov 25, 2015
Latest reply on Dec 10, 2015 by James Hall

Hi all,

 

We are having trouble replacing the defining contour of an extruded feature body.

We have generated a new set of SketchSegments, found the SketchContour containing these segments and

are attempting to replace a previously specified contour with the new contour we have created.

  • Is it possible to change the contour of an extruded feature, a "BossThin" feature in this case?
    • If so what are the prerequisites for a contour to be applied to an extruded feature, a "BossThin" feature in this case?
    • Can a PropertyManagment page be open while making the change?
    • Can a sketch be active while making the change

 

 

Here is a snippet of what we think should achieve our goal but is not working.

No sketch is active.

This is in the OnClose of a PropertyManagmentPage.

 

Where selectedFeature is the feature to modify

Where foundContour is the contour we would like to define the ExtrudeFeature

 

ExtrudeFeatureData2 fd = selectedFeature.GetDefinition() as ExtrudeFeatureData2;
fd.AccessSelections(targetDocument, null);
int contourCount = fd.GetContoursCount();
object[] sketchContours = fd.Contours;
if (null == fd.Contours) {
fd.Contours = new object[1];
}
fd.Contours[0] = foundContour;
bool result = selectedFeature.ModifyDefinition(fd, targetDocument, null);

 

Any suggestions would be greatly appreciated

Thanks

Outcomes