Hello Guys,
I have a similar issue: I want to Change the Color of a hatch region, that has a certain hatch pattern. For the HatchRigion.Color-Object, we have a Method that calls "SetColor(Red as Byte, Green as Byte, Blue as Byte)" available.
I was happy to found this:
https://forums.autodesk.com/t5/inventor-programming-ilogic/accessing-quot-edit-hatch-pattern-quot-in...
I took it and customized it for my usecase, ended up with this:
(you can ignore the Plasibility Test - which was postiv btw)
oDDoc = ThisDrawing.Document
oSheet = oDDoc.ActiveSheet
For Each oView As DrawingView In oSheet.DrawingViews
If oView.ViewType = DrawingViewTypeEnum.kSectionDrawingViewType Then
Dim oSView As SectionDrawingView = oView
For Each oHatchR As DrawingViewHatchRegion In oSView.HatchRegions
'check pattern type for concrete
If oHatchR.Pattern.Name = "AR-CONC"
oHatchR.Color.SetColor(192, 192, 192)
' ' Plausibility test for access to the HatchRegion-Object:
' If oHatchR.DoublePattern = True
' oHatchR.DoublePattern = False
' Else
' oHatchR.DoublePattern = True
' End If
End If
Next
End If
Next
My Problem: the SetColor-Method does nothing...
Doing the job manually is like:

What did I do wrong? Do I have to assign sth like a Color-Object to oHatchR.Color, to overwrite it, instead of just giving the RGB-Values?
(I am working with Inventor 2023.5.2)
Thanks for your help so much in advance
BR Raphael