Hi @ivanildo.b. I could not use the part you posted, because it must be a 2023 file, and I am still using 2022.4, but I think I have an iLogic rule that will work for a part like that one. I customized it to use the user parameter you are showing. It finds the largest face, then finds all interior, circular edges, and counts them. Then writes that value to the user parameter named "how_many_holes".
Dim oPDoc As PartDocument = ThisDoc.Document
Dim oPDef As PartComponentDefinition = oPDoc.ComponentDefinition
Dim oBody As SurfaceBody = oPDef.SurfaceBodies.Item(1)
Dim oFaces As Faces = oBody.Faces
Dim oLargestFace As Face
Dim oLargestArea As Double
For Each oFace As Face In oFaces
If oFace.Evaluator.Area > oLargestArea Then
oLargestArea = oFace.Evaluator.Area
oLargestFace = oFace
End If
Next
Dim oELs As EdgeLoops = oLargestFace.EdgeLoops
Dim oInteriorCircleEdges As Integer
For Each oEL As EdgeLoop In oELs
If oEL.IsOuterEdgeLoop Then Continue For
If oEL.Edges.Count = 1 And _
oEL.Edges.Item(1).GeometryType = CurveTypeEnum.kCircleCurve Then
oInteriorCircleEdges = oInteriorCircleEdges + 1
End If
Next
Logger.Info("Interior Circle Edges Count = " & oInteriorCircleEdges)
Parameter("how_many_holes") = oInteriorCircleEdges
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)