- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'd like to know how to control colors of the MarkStyle trough API.
I've created a primitive iLogic-rule that I hoped would do the desired:
If Not TypeOf ThisDoc.Document Is PartDocument Then MsgBox("Not a part") : Return
Dim pDoc As PartDocument = ThisDoc.Document
If pDoc.ActiveMarkStyle Is Nothing Then MsgBox("There is no active mark style") : Return
Dim actMrkStyle = pDoc.ActiveMarkStyle
logger.info("actMrkStyle.Name: " & actMrkStyle.Name)
Dim fColor As Color = actMrkStyle.FrontLayerColor
Dim initRcode = fColor.Red
fColor.SetColor(0, 0, 0)
MsgBox("initial: " & initRcode & vbLf & "new: " & fColor.Red, , "Red-code")
It reads initial Red-value of the FrontLayerColor (Yellow), sets new Color value (0,0,0 - Black) and finally reads/prints both initial (255) and new (0) Red-values.
New printed value corresponds to the expectations .. but .. if the rule is run for the second time it then prints that same initial red value (255) as during first rule run and I don't see any color changes in UI either.
See attached the sample part model to reproduce the described (it is taken from "Get Started with Mark Feature" interactive tutorials for Inventor 2023).
PS:
@MjDeck could you please look at this case?
PPS:
I've tried Inventor 2024.3.2 and 2025.1.2 and have got the same result.
Please vote for Inventor-Idea Text Search within Option Names
Solved! Go to Solution.