Thanks for all the great suggestions!
Since the parts I'm working with are complex, I want to keep them as dumb geometry, so Feature Recognition isn't ideal. I also wanted to avoid lots of steps and extra files, so Shrinkwrap would be a little to tedious.
Not sure why I assumed iLogic wouldn't be able to handle this. As usual, I was wrong, and as usual, Curtis set me straight.
With that helpful start I was able to put together a more complete rule that fits my needs. First, if there are multiple bodies, it prompts to select which body to operate on. Then it allows me to try several different radius limits and preview which faces will be deleted. I can also measure an existing fillet's radius for a starting point.
One important thing I added is the rule tries to select any tangent "fillet transition faces". If fillet transition faces/corners aren't selected then the Delete Face usually fails because it can't heal the corners properly in response to adjacent fillets being removed.
Anyway, if I'm happy with the preview I can say OK to automatically do the Delete Face, or I can cancel out to manually edit the selection before deleting myself.
In the small amount of testing I did with my test parts (attached), it successfully selects all necessary fillets and fillet transition faces without needing any manual selection-set tweaking. I'm sure it's far from perfect though. If anyone else uses this and runs into issues please share them here so it can be refined.
Thanks again for getting me started, Curtis!
NOTE: This rule is set up for working in inches. If working in cm, change "InputUnitToCM" to 1. If working in mm, change it to 0.1. And likewise for other units.
Dim oDoc As PartDocument
oDoc = ThisApplication.ActiveEditDocument
InputUnitToCM = 2.54 'Conversion factor from input units to iLogic working units (centimeters)
'Create a reference to the component definition.
Dim oCompDef As PartComponentDefinition
oCompDef = oDoc.ComponentDefinition
Dim oFaceColl As FaceCollection
oFaceColl = ThisApplication.TransientObjects.CreateFaceCollection
Dim oSurfaceBody As SurfaceBody
Dim oFace As Face
Dim oFace2 As Face
oDoc.SelectSet.Clear
If oDoc.ComponentDefinition.SurfaceBodies.Count > 1 Then
'Prompt to select a body
oSurfaceBody = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kPartBodyFilter, "Pick a Body to operate on")
Else
oSurfaceBody = oDoc.ComponentDefinition.SurfaceBodies(1)
End If
Dim UserInput As String
Dim MaxRadius As Double
Dim oRadius As Double
UserInputDefault = "a"
GetUserInput:
PreviousUserInput = UserInput
UserInput = InputBox("Enter the max fillet radius to delete (fillets of exactly this size WILL be deleted)" & vbNewLine & vbNewLine & "Type ""a"" to select all fillets or ""m"" to measure a reference fillet size." & vbNewLine & vbNewLine & "When satisfied, type ""d"" or simply hit Enter/OK to delete selection." & vbNewLine & vbNewLine & "To cancel, type ""c"" or hit Esc/Cancel to keep the selection and exit without deleting.", "Auto-Delete Fillet Faces", UserInputDefault)
Select Case UserInput
Case "" 'Cancel
Return
Case "m"
oCamera = ThisApplication.ActiveView.Camera
oCircularEdge = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kPartEdgeCircularFilter, "Select a circular edge")
If oCircularEdge Is Nothing Then Goto GetUserInput
Try
oRadius = oCircularEdge.Geometry.Radius
MaxRadius = Ceil(oRadius * 100000) / 100000 'Round up to nearest .00001 cm
Catch
MessageBox.Show("Could not get a radius from the selected arc. It may be an elliptical arc." & vbNewLine & vbNewLine & "Please try a different input.","Radius Measure Error",MessageBoxButtons.OK,MessageBoxIcon.Error)
Goto GetUserInput
End Try
UserInputDefault = MaxRadius / InputUnitToCM 'Convert to input units
UserInput = UserInputDefault 'This is so that if the user simply hits "Enter" again, the selected faces will be deleted
'Restore the camera to its location from before taking the measurement
oCamera.Apply
'Continue on to select fillet faces
Case "d",PreviousUserInput
oCount = oFaceColl.count
If oCount > 0 Then
Try
oTransaction = ThisApplication.TransactionManager.StartTransaction(ThisDoc.Document, "Auto-delete Fillet Faces Under " & Round(MaxRadius/InputUnitToCM,5))
Dim oDeleteFace As DeleteFaceFeature
oDeleteFace = oCompDef.Features.DeleteFaceFeatures.Add(oFaceColl, True)
oTransaction.End
MessageBox.Show(oCount & " faces successfully deleted.")
Return
Catch
oTransaction.Abort
MessageBox.Show("An error occurred while attempting to delete the selected faces.")
Return
End Try
Else
MessageBox.Show("No faces were deleted.")
Return
End If
Case "a"
MaxRadius = 0
UserInputDefault = "a"
'Continue on to select fillet faces
Case Else
Try
If UserInput > 0 Then
MaxRadius = Ceil(CDbl(UserInput) * InputUnitToCM * 100000)/100000 'Convert to cm, then round up to nearest .00001 cm
UserInputDefault = UserInput
'Continue on to select fillet faces
Else
MessageBox.Show("An invalid max radius was entered. Please make a valid entry.")
Goto GetUserInput
End If
Catch
MessageBox.Show("An invalid max radius was entered. Please make a valid entry.")
Goto GetUserInput
End Try
End Select
oDoc.SelectSet.Clear
oFaceColl.Clear
For Each oFace In oSurfaceBody.Faces
If oFace.SurfaceType = SurfaceTypeEnum.kCylinderSurface And oFace.GeometryForm.Equals(9) Then
oRadius = Floor(oFace.Geometry.Radius * 100000) / 100000 'Round down to nearest .00001 cm
If MaxRadius = 0 Or oRadius <= MaxRadius Then
'Geometry Form = 9 ensures that no cylindrical holes will be selected.
oDoc.SelectSet.Select(oFace)
oFaceColl.Add(oFace)
'Now check for tangent fillet "transition" faces, which need to be selected or else the Delete Face operation will fail.
For Each oFace2 In oFace.TangentiallyConnectedFaces
If oFace2.SurfaceType = SurfaceTypeEnum.kSphereSurface Or oFace2.SurfaceType = SurfaceTypeEnum.kTorusSurface Or oFace2.SurfaceType = SurfaceTypeEnum.kBSplineSurface Then
oDoc.SelectSet.Select(oFace2)
oFaceColl.Add(oFace2)
End If
Next 'Tangent face
End If
End If
Next 'Face
Goto GetUserInput