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

See if this works for you.  It follows the same idea, but gets the hole notes instead.  They would have to have been made as HoleThreadNotes using the designated "Hole and Thread" tool on the Annotate tab > Feature Notes panel, for this to work.  If they are just regular leader notes or regular dimensions, we would need to include a lot more code to check those types of things too.

 

If ThisApplication.ActiveDocumentType <> DocumentTypeEnum.kDrawingDocumentObject Then
	MsgBox("A Drawing Document must be active for this rule (" & iLogicVb.RuleName & ") to work. Exiting.",vbOKOnly+vbCritical, "WRONG DOCUMENT TYPE")
	Exit Sub
End If
Dim oDDoc As DrawingDocument = ThisDrawing.Document
Dim oSheet As Inventor.Sheet = oDDoc.ActiveSheet
Dim oTO As TransientObjects = ThisApplication.TransientObjects
Dim oColor As Color

oAns = MsgBox("Highlight [Yes] or UnHighlight [No]", vbYesNo + vbQuestion, "")
If oAns = vbYes Then
	oColor = oTO.CreateColor(255, 0, 255)
Else
	oColor = oTO.CreateColor(0, 0, 0)
	oColor.ColorSourceType = ColorSourceTypeEnum.kLayerColorSource
End If

Dim oHoleNotes As Inventor.HoleThreadNotes = oSheet.DrawingNotes.HoleThreadNotes
If oHoleNotes.Count > 0 Then
	For Each oHN As HoleThreadNote In oHoleNotes
		If oHN.ModelValueOverridden Then
			oHN.Text.Color = oColor
		End If
	Next
End If

 

If this solved your problem, or answered your question, please click ACCEPT SOLUTION.
Or, if this helped you, please click 'LIKE' :thumbs_up:.

If you have time, please... Vote For My IDEAS :light_bulb:and Explore My CONTRIBUTIONS

Inventor 2021 Help | Inventor Forum | Inventor Customization Forum | Inventor Ideas Forum

 

Wesley Crihfield

EESignature

(Not an Autodesk Employee)