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

Design data are at a central location. They have been for years. And it works, because all recent parts have the tap diameters we changed in the thread.xls file.

 

Also:

 

Sub ThreadFix()
    Dim pDoc As PartDocument
    Set pDoc = ThisApplication.ActiveDocument
    Dim oCompdef As PartComponentDefinition
    Set oCompdef = pDoc.ComponentDefinition
    Dim oHole As HoleFeature
    Set oHole = oCompdef.Features.HoleFeatures.item(1)
    Dim oTappedHole As HoleTapInfo
    Set oTappedHole = oHole.TapInfo
    
    oTappedHole.TapDrillDiameter = 13.37 '<~~ wrong!
    
    Debug.Print "Before: " & oTappedHole.TapDrillDiameter       'Before: 13,37

    Dim newTappedHole As HoleTapInfo
    If oTappedHole.FullTapDepth Then
        Set newTappedHole = oCompdef.Features.HoleFeatures.CreateTapInfo( _
                                    RightHanded:=oTappedHole.RightHanded, _
                                    ThreadType:=oTappedHole.ThreadType, _
                                    ThreadDesignation:=oTappedHole.ThreadDesignation, _
                                    Class:=oTappedHole.Class, _
                                    FullTapDepth:=oTappedHole.FullTapDepth)
    Else
        Set newTappedHole = oCompdef.Features.HoleFeatures.CreateTapInfo( _
                                    RightHanded:=oTappedHole.RightHanded, _
                                    ThreadType:=oTappedHole.ThreadType, _
                                    ThreadDesignation:=oTappedHole.ThreadDesignation, _
                                    Class:=oTappedHole.Class, _
                                    FullTapDepth:=oTappedHole.FullTapDepth, _
                                    ThreadDepth:=oTappedHole.ThreadDepth)
    End If
                                
    Debug.Print "'After': " & newTappedHole.TapDrillDiameter    ''After': 10,4

    Set oHole.TapInfo = newTappedHole   '<~~ Nope

 

 

The new TapInfo object has the correct tap diameter. I just can't apply it to the existing hole feature.