Hi @hieut1392. The short answer is, maybe, depending on several things. First of all, not 'all' edges and not 'all' corners shown in that part have been given a fillet, so that means there needs to be a way of choosing or identifying which edges of the model to apply a fillet feature to, and which ones to not attempt to apply a fillet feature to...by code. Then, since this is not a sheet metal part, and there appears to be multiple radius values being used, we would have to know what radius to use in each situation, and to do that you would need to know where the fillet is being applied on the part, which is difficult to do by code. If you specify a radius that is too big for the situation, it will throw an error. There are ways of assigning names to faces, edges, and vertices, but that would require a lot more preparation ahead of using the code, and require more code too, to retrieve the named pieces of geometry and make sure appropriate radii are used for certain specific edges when they get a fillet. There is a lot involved.
Here is the simplest iLogic rule that will attempt to simply apply a 1/8 inch radius to 'all' edges in an existing part model though, just as an example to get you started.
If ThisDoc.Document.DocumentType <> DocumentTypeEnum.kPartDocumentObject Then
MsgBox("A Part Document must be active for this rule to work. Exiting.", vbCritical, "")
Exit Sub
End If
Dim oPDoc As PartDocument = ThisDoc.Document
Dim oPDef As PartComponentDefinition = oPDoc.ComponentDefinition
If oPDef.SurfaceBodies.Count = 0 Then Exit Sub
Dim oBody As SurfaceBody = oPDef.SurfaceBodies.Item(1)
Dim oFilletFeats As FilletFeatures = oPDef.Features.FilletFeatures
For Each oEdge As Edge In oBody.Edges
Dim oEdgeCol As EdgeCollection = ThisApplication.TransientObjects.CreateEdgeCollection
oEdgeCol.Add(oEdge)
Dim oRadius As String = "1/8 in"
Dim oFillet As FilletFeature = Nothing
Try
oFillet = oFilletFeats.AddSimple(oEdgeCol, oRadius)
Catch
End Try
Next
If this solved your problem, or answered your question, please click ACCEPT SOLUTION .
Or, if this helped you, please click (LIKE or KUDOS) 👍.
Wesley Crihfield

(Not an Autodesk Employee)