Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
Anonymous
in reply to: Anonymous

Hi Udo.eckardt,

 

Welcome to the Comumunity!!

 

I hope the following code will be helpful for your requirement.

 

SyntaxEditor Code Snippet

Dim oPart As Document

oPart = ThisApplication.ActiveDocument
Dim oHoleFeature As HoleFeature
For Each oHoleFeature In oPart.ComponentDefinition.Features.HoleFeatures
Dim oHoleType As String
If oHoleFeature.HoleType = 21507 Then
oHoleType = "CounterBoreHole"
ElseIf oHoleFeature.HoleType = 21506 Then
oHoleType = "CounterSinkHole"
ElseIf oHoleFeature.HoleType = 21505 Then
oHoleType = "DrilledHole"
ElseIf oHoleFeature.HoleType = 21508 Then
oHoleType = "SpotFaceHole"
End If
MsgBox ("Counter bore Diameter: " & oHoleFeature.CBoreDiameter.Value & vbNewLine & _
        "Counter Bore Depth: " & oHoleFeature.CBoreDepth.Value & vbNewLine & _
        "Hole Type: " & oHoleType & vbNewLine & _
        "Hole Name:" & oHoleFeature.Name & "")
Next