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: Michael.Navara

I'm am indeed able to create a new TapInfo object. I create this object using the properties of the existing hole. This works. The object is created, and with the correct tap drill diameter (so thread.xls is involved in this operation).

 

But I can't assign this new TapInfo object to the existing Hole feature.

 

 

Private 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

    Dim newTappedHole As HoleTapInfo
    Set newTappedHole = oCompdef.Features.HoleFeatures.CreateTapInfo( _
                                RightHanded:=oTappedHole.RightHanded, _
                                ThreadType:=oTappedHole.ThreadType, _
                                ThreadDesignation:=oTappedHole.ThreadDesignation, _
                                Class:=oTappedHole.Class, _
                                FullTapDepth:=oTappedHole.FullTapDepth)

    Set oHole.TapInfo = newTappedHole   '<~~ Nope
End Sub