Hi @Darkforce_the_ilogic_guy. The iLogic rule I was preparing for you is pretty similar, but just includes the extra check to see if the thread Class is currently set to "6H" or "6h", before attempting to change its Class to ".". There are several ways you may prefer to get/identify the drawing document, and/or the 'Model' document, so I just kept that part fairly simple. I don't know if your drawing document is just for the one model, or if there are multiple models, but this code just gets the first model, for simplicity. I also just assumed that the model would be a Part, due to the threaded hole features, so if your model is not a part, it will not work the way it currently is. I also threw a couple of updates in there at the end.
Sub Main
'get the Drawing (one way or another)
If ThisDoc.Document.DocumentType <> DocumentTypeEnum.kDrawingDocumentObject Then
MsgBox("A Drawing Document must be active for this code to work. Exiting.", vbCritical, "")
Exit Sub
End If
Dim oDDoc As DrawingDocument = ThisDoc.Document
'get Model (again, which ever way you want)
Dim oModel As Document = ThisDoc.ModelDocument
If oModel Is Nothing Then
MsgBox("No 'Model' found. Exiting.", vbCritical, "")
Exit Sub
End If
'I assume it will be a Part because of threaded HoleFeatures
If oModel.DocumentType <> DocumentTypeEnum.kPartDocumentObject Then
MsgBox("'Model' was not a part. Exiting.", vbCritical, "")
Exit Sub
End If
Dim oPDoc As PartDocument = oModel
oPDef = oPDoc.ComponentDefinition
oHFeats = oPDef.Features.HoleFeatures
For Each oHFeat As HoleFeature In oHFeats
If Not oHFeat.Tapped Then Continue For
Dim oHTInfo As HoleTapInfo = oHFeat.TapInfo
If oHTInfo.ThreadType <> "Kallesoe Metric profile" Then Continue For
'If oHTInfo.ThreadTypeIdentifier <> "Kallesoe Metric profile" Then Continue For
If oHTInfo.Class = "6H" Or oHTInfo.Class = "6h" Then
Try
oHTInfo.Class = "."
Catch
MsgBox("Failed to change thread 'Class' to '.'", vbExclamation, "")
End Try
End If
Next
oPDoc.Update
oDDoc.Update
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) 👍.
If you want and have time, I would appreciate your Vote(s) for My IDEAS :bulb: or you can Explore My CONTRIBUTIONS
Wesley Crihfield

(Not an Autodesk Employee)