Addin - HighLightSet Color not respecting Opacity value

Addin - HighLightSet Color not respecting Opacity value

josh.nieman
Advocate Advocate
284 Views
1 Reply
Message 1 of 2

Addin - HighLightSet Color not respecting Opacity value

josh.nieman
Advocate
Advocate

I've been troubleshooting this particular function for a while and am having trouble adjusting the highlight set opacity. No matter what value I use from 0.0 to 1.0 it doesn't seem to change.

I'm worried user-settings are controlling this, rather than the code-specified values.

What I'm doing is iterating through all the hole features in all parts in an assembly. Based upon certain criteria, I add the each face in the FACES collection, of qualifying holes (HoleFeatureProxy.Faces) to an ObjectCollection.
I then create a HighlightSet in the active document, and add those ObjectCollection objects to the HighlightSet.


I have assigned many different values of opacity but all results appear the same, regardless, test after test.

joshnieman_0-1726243997978.png



I start with known RGB color values; example:

Private _Size03 As Drawing.Color = Drawing.Color.FromArgb(77, 175, 74) 'Medium Green


Then create the Inventor.Color object from those values.

Private _InvColor03 As Inventor.Color = g_inventorApplication.TransientObjects.CreateColor(_Size03.R, _Size03.G, _Size03.B, 0.4)

 Here you can see I assign "0.4" but whether I put in "0.0" or "1.0" or anything between, the resultant highlight appearance is identical.

Creating the object collection, adding things to it, etc... 

Dim objCol_Size03 as ObjectCollection
Dim hs_Holes_Size03 as HighlightSet
'...
objCol_Size03 = g_inventorApplication.TransientObjects.CreateObjectCollection
'....
'>>>>> Example of how faces are added to the ObjCol:
For Each f As Face In hole.HoleProxy.Faces
   objCol_Size03.Add(f)
Next
'...
hs_Holes_Size03 = curDoc.CreateHighlightSet
        If objCol_Size03.Count > 0 Then
            hs_Holes_Size03.Color = holeColorSchemeCol.InvColor_Size03
            hs_Holes_Size03.AddMultipleItems(objCol_Size03)
        End If


Everything functions fine, and as expected.

I just can't find any clarification about WHAT other things I should be looking at that's controlling the opacity of my highlighting.

Does anyone have any suggestions? 

0 Likes
Accepted solutions (1)
285 Views
1 Reply
Reply (1)
Message 2 of 2

josh.nieman
Advocate
Advocate
Accepted solution

Of course, as soon as I post, I see the forest for the trees.

The opacity is working exactly as intended.  When viewing the face directly, the opacity _is_ varying.

What I was trying to make bolder/brighter was the OBSCURED faces, where you can see the highlighted faces, but they're being other non-highlighted faces in the foreground.

That is not what OPACITY of the Inventor.Color object affects. I'll have to look elsewhere to even see if that is something that can be manipulated.

I believe I have my answer.

0 Likes