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

It can be done differently,

 

Look for clearance.xls in your style folder, you can read values from it to get fastener size and corresponding diameters.

Give to user fasteners sizes in combo, and when he choose one, your script will change hole diameter looking for corresponding one to chosen fastener.

 

use something like:

 

Sub subWNHolefeatureUpdate()
    Dim oWNPartDoc As PartDocument
    Set oWNPartDoc = ThisApplication.ActiveDocument
    Dim oWNHoleFeature As HoleFeature
    Set oWNHoleFeature = oWNPartDoc.ComponentDefinition.Features.HoleFeatures.Item(1)
       'oWNHoleFeature.HoleDiameter.Value = 10 ' in cm - corresponding value read from xls
       oWNHoleFeature.HoleDiameter.Expression = "6,6"  - corresponding value read from xls
       
       oWNPartDoc.Update
End Sub