01-17-2022
07:16 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
01-17-2022
07:16 AM
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