Hi @Naoufel_EMW. Here is an iLogic rule you can try out that will attempt to count the number of extruded circles that are set to cut, within the document you run the rule on. It does not attempt to count any holes that are created using the a HoleFeature. This can be ran from an assembly, or a part. If ran from an assembly, it will only find ones that were created within the context of the assembly itself, not ones that were created within the context of any components.
Dim oDoc As Document = ThisDoc.Document
Dim oExtrudeFeats As ExtrudeFeatures
If oDoc.DocumentType = DocumentTypeEnum.kAssemblyDocumentObject Or _
oDoc.DocumentType = DocumentTypeEnum.kPartDocumentObject Then
oExtrudeFeats = oDoc.ComponentDefinition.Features.ExtrudeFeatures
Else
MsgBox("This rule only works on Parts or Assemblys. Exiting.", vbCritical, "")
Exit Sub
End If
If IsNothing(oExtrudeFeats) OrElse oExtrudeFeats.Count = 0 Then Exit Sub
Dim oHoleCount As Integer = 0
For Each oEFeat As ExtrudeFeature In oExtrudeFeats
If oEFeat.Suppressed OrElse _
oEFeat.Definition.Operation <> PartFeatureOperationEnum.kCutOperation Then
Continue For
End If
oProfile = oEFeat.Definition.Profile
For Each oPath As ProfilePath In oProfile
If oPath.Closed = False Then Continue For
If oPath.Item(1).CurveType = Curve2dTypeEnum.kCircleCurve2d Then
oHoleCount = oHoleCount + 1
End If
Next
Next
MsgBox("oHoleCount = " & oHoleCount,,"")
If this solved your problem, or answered your question, please click ACCEPT SOLUTION.
Or, if this helped you, please click (LIKE or KUDOS) 👍.
If you want and have time, I would appreciate your Vote(s) for My IDEAS :bulb: or you can Explore My CONTRIBUTIONS
Wesley Crihfield

(Not an Autodesk Employee)