Hi @f_slezakQ4FV2. There are two main types of features that can involve threads (HoleFeature, and ThreadFeature). I'm not sure if that/those iLogic shortcut snippet(s) will work the way you want for a HoleFeature, but they may. Below are some links to the online documentation for those iLogic shortcut tools/methods:
Feature (ICadFeature Interface)
ICadFeature.ThreadClass Property (String)
ICadFeature.ThreadClass Property (Object, String)
ICadFeature.ThreadDesignation Property (String)
ICadFeature.ThreadDesignation Property (Object, String)
ICadFeature.ThreadType Property (String)
ICadFeature.ThreadType Property (Object, String)
One of these two below are required when you need to set more than one property at a time.
ICadFeature.SetThread Method (String, String, String, String)
ICadFeature.SetThread Method (Object, String, String, String, String)
However, those are all specific to the iLogic add-in, and are not really designed to effect every feature in a part by themselves, because they require you to specify the feature by its name, instead of the feature object itself. The 'original/primary' way to do these same tasks is with the Inventor API tools/properties.
HoleFeature.Tapped
HoleFeature.TapInfo (returns an Object, not a String, and is where most detailed data is kept)
ThreadFeature.SetThreadDepth (method)
ThreadFeature.DirectionReversed (Read/Write Property)
ThreadFeature.FullDepth (Read/Write Property)
ThreadFeature.ThreadDepth (ReadOnly)
ThreadFeature.ThreadInfo (returns an Object, not a String, and is where most detailed data is kept)
Below is just some 'starter' code for use in an iLogic rule for trying to make these changes using Inventor API code. Once it gets to the 'TapInfo or ThreadInfo' property, that property returns one type of object, or another, depending on if it was tapered or not (StandardThreadInfo or TaperedThreadInfo or HoleTapInfo). That object will have tons of properties, covering all possible aspects of the thread specifications that you can change. Then, once you have made those changes to that object, you will need to set that object back as the new value of that TapInfo or ThreadInfo property, because it is a Read/Write property.
Sub Main
Dim oInvApp As Inventor.Application = ThisApplication
Dim oPDoc As PartDocument = TryCast(ThisDoc.Document, Inventor.PartDocument)
If oPDoc Is Nothing Then Return
Dim oPDef As PartComponentDefinition = oPDoc.ComponentDefinition
Dim oThreadFeats As ThreadFeatures = oPDef.Features.ThreadFeatures
For Each oTF As ThreadFeature In oThreadFeats
If oTF.ThreadInfoType = ThreadTypeEnum.kStandardThread Then
Dim oSTI As StandardThreadInfo = oTF.ThreadInfo
'set/change its properties (to many to list here)
Else
Dim oTTI As TaperedThreadInfo = oTF.ThreadInfo
'set/change its properties (to many to list here)
End If
Next oTF
Dim oHoleFeats As HoleFeatures = oPDef.Features.HoleFeatures
For Each oHF As HoleFeature In oHoleFeats
If Not oHF.Tapped Then Continue For
'if regular, straight tapped hole, then use HoleTapInfo
Dim oHTI As HoleTapInfo = oHF.TapInfo
'make changes to HoleTapInfo object properties here
'too many properties to list here
'If tapered threads, then use TaperedThreadInfo
'Dim oTTI As TaperedThreadInfo = oHF.TapInfo
Next oHF
oPDoc.Update2(True)
'oPDoc.Save()
End Sub
If this solved your problem, or answered your question, please click ACCEPT SOLUTION .
Or, if this helped you, please click (LIKE or KUDOS) 👍.
Wesley Crihfield

(Not an Autodesk Employee)