Q:
We created a extrusion feature, then we had made changes to the original Extrusion, e.g. create a hole with a cut Extrusion, Now we want to change the Extrusion Feature by moving one of the WorkPlane objects (or to select another one, as it is possible per UI), but we don't want to create a new Workplane object, because in this case I have to create a new extrusion, all changes are lost. So we need to have the possibility to change the extrusion and Inventor "regenerates" this extrusion and all other features in this part are still active.
A:
The below is a sample of changing the workplane for a hole feature in a part document.
Public Sub ChangeWPlaneOfHole(ByVal app As Inventor.Application)
Dim oDef As PartComponentDefinition
oDef = app.ActiveDocument.ComponentDefinition
'Get the hole feature
Dim oHoleFeat As HoleFeature
oHoleFeat = oDef.Features.HoleFeatures.Item(1)
'Get another workplane, assumes at least 5
'workplanes exist in the part
Dim oWorkplane As WorkPlane
oWorkplane = oDef.WorkPlanes.Item(5)
'Assign it to the hole feature
oHoleFeat.SetToFaceExtent(oWorkplane, True)
End Sub