<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic how to change custom icon to gray in browser pane when set its visibility to false? in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-change-custom-icon-to-gray-in-browser-pane-when-set-its/m-p/11145805#M137666</link>
    <description>&lt;P&gt;Hi, experts,&lt;/P&gt;&lt;P&gt;I create some custom icon for our part in an assembly as below picture. The way I do it is referring to:&lt;/P&gt;&lt;P&gt;&lt;A href="https://adndevblog.typepad.com/manufacturing/2012/08/change-the-browser-node-icon.html" target="_blank"&gt;https://adndevblog.typepad.com/manufacturing/2012/08/change-the-browser-node-icon.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://adndevblog.typepad.com/manufacturing/2015/01/change-icon-of-clientfeature-node-in-built-in-browser-pane.html" target="_blank"&gt;https://adndevblog.typepad.com/manufacturing/2015/01/change-icon-of-clientfeature-node-in-built-in-browser-pane.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to go a little bit further. For a regular part icon, if you right click the part and turn the "visibility" off, the icon will go gray. But for a custom icon, it always stay the same. Is there any way to make custom icon turn gray when the part visibility is false?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="liminma8458_0-1651622007462.png" style="width: 480px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1062751i6788880102A75BE3/image-dimensions/480x209?v=v2" width="480" height="209" role="button" title="liminma8458_0-1651622007462.png" alt="liminma8458_0-1651622007462.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 03 May 2022 23:59:51 GMT</pubDate>
    <dc:creator>liminma8458</dc:creator>
    <dc:date>2022-05-03T23:59:51Z</dc:date>
    <item>
      <title>how to change custom icon to gray in browser pane when set its visibility to false?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-change-custom-icon-to-gray-in-browser-pane-when-set-its/m-p/11145805#M137666</link>
      <description>&lt;P&gt;Hi, experts,&lt;/P&gt;&lt;P&gt;I create some custom icon for our part in an assembly as below picture. The way I do it is referring to:&lt;/P&gt;&lt;P&gt;&lt;A href="https://adndevblog.typepad.com/manufacturing/2012/08/change-the-browser-node-icon.html" target="_blank"&gt;https://adndevblog.typepad.com/manufacturing/2012/08/change-the-browser-node-icon.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://adndevblog.typepad.com/manufacturing/2015/01/change-icon-of-clientfeature-node-in-built-in-browser-pane.html" target="_blank"&gt;https://adndevblog.typepad.com/manufacturing/2015/01/change-icon-of-clientfeature-node-in-built-in-browser-pane.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to go a little bit further. For a regular part icon, if you right click the part and turn the "visibility" off, the icon will go gray. But for a custom icon, it always stay the same. Is there any way to make custom icon turn gray when the part visibility is false?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="liminma8458_0-1651622007462.png" style="width: 480px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1062751i6788880102A75BE3/image-dimensions/480x209?v=v2" width="480" height="209" role="button" title="liminma8458_0-1651622007462.png" alt="liminma8458_0-1651622007462.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 May 2022 23:59:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-change-custom-icon-to-gray-in-browser-pane-when-set-its/m-p/11145805#M137666</guid>
      <dc:creator>liminma8458</dc:creator>
      <dc:date>2022-05-03T23:59:51Z</dc:date>
    </item>
    <item>
      <title>Re: how to change custom icon to gray in browser pane when set its visibility to false?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-change-custom-icon-to-gray-in-browser-pane-when-set-its/m-p/11146382#M137671</link>
      <description>&lt;P&gt;Hi Liminma,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not completely sure, but I'm gonna need this for a tool of myself soon so I looked into it a while ago.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The NativeBrowserNodeDefinition object has three icons you can specify, the OverrideIcon, OverrideExpandedIcon, and OverrideStateIcon. There's another property 'AdditionalDisplayState'. I think you have to play with the&amp;nbsp;AdditionalDisplayState and&amp;nbsp;OverrideStateIcon&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I had a problem with my icon getting a black background. I see yours doesn't. Does your icon have a transparent background? Does it also work in dark mode?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 May 2022 07:05:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-change-custom-icon-to-gray-in-browser-pane-when-set-its/m-p/11146382#M137671</guid>
      <dc:creator>basautomationservices</dc:creator>
      <dc:date>2022-05-04T07:05:19Z</dc:date>
    </item>
    <item>
      <title>Betreff: how to change custom icon to gray in browser pane when set its visibility to false?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-change-custom-icon-to-gray-in-browser-pane-when-set-its/m-p/11146535#M137681</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Since Inventor 2022 there are some improvements I found some days ago. You can create a ClientResourceMap and add the different Icons. There is also support for different themes included.&lt;/P&gt;&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/10337235"&gt;@basautomationservices&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry, found that a while after your threads. But I did not found a solution for transparancy problem somewhere in there.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's a small VBA sample demonstrating the core functionality. It assumes there are two bitmaps (16x16pixel) in C:\temp and the active theme in Inventor is the dark theme. Otherwise you need to adjust the code.&lt;/P&gt;&lt;P&gt;Select a part in your assembly and run the sample. This override works just for the node of the selected part. If you place another occurrence of the same part, the standard icons are displayed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Sub modifyIcon()


Dim oApp As Application
Set oApp = ThisApplication

Dim oDoc As AssemblyDocument
Set oDoc = oApp.ActiveDocument

'Get the ClientResourceMap or create a new one
On Error Resume Next
Dim oClientResourceMap As ClientResourceMap
    Set oClientResourceMap = oApp.ClientResourceMaps.ItemById("MyTestResourceMap", 1)
If Err.Number &amp;lt;&amp;gt; 0 Then
    Set oClientResourceMap = oApp.ClientResourceMaps.Add("MyTestResourceMap", 1)

    Dim oIcon_1 As IPictureDisp
    Set oIcon_1 = stdole.LoadPicture("C:\temp\1.bmp")
    
    Dim oIcon_2 As IPictureDisp
    Set oIcon_2 = stdole.LoadPicture("C:\temp\1_gray.bmp")
    
    Dim oNVMap As NameValueMap
    Set oNVMap = oApp.TransientObjects.CreateNameValueMap
    
    Call oNVMap.Add("Icon1", oIcon_1)
    Call oNVMap.Add("Icon2", oIcon_2)
    
    Call oClientResourceMap.SetBrowserIconData(oNVMap, "DarkTheme", True)
End If

On Error GoTo 0

'Get the ClientNodeResource in the actvie BrowserPane or create it
Dim oBP As BrowserPane
Set oBP = oDoc.BrowserPanes.ActivePane

Dim oNode As BrowserNode
Set oNode = oBP.TopNode.BrowserNodes.Item(oBP.TopNode.BrowserNodes.count - 1)

On Error Resume Next
Dim oCNRes As ClientNodeResource
Set oCNRes = oDoc.BrowserPanes.ClientNodeResources.ItemById("MyTestResourceMap", 1)
If Err.Number &amp;lt;&amp;gt; 0 Then
    Set oCNRes = oDoc.BrowserPanes.ClientNodeResources.AddNodeResource("MyTestResourceMap", 1, "Icon1")
End If

oCNRes.InvisibleIconName = "Icon2"

'assign the ClientNodeResource as Override to the selected Browsernode
Dim oBNDef As NativeBrowserNodeDefinition
Set oBNDef = oDoc.BrowserPanes.GetNativeBrowserNodeDefinition(oDoc.SelectSet(1))

oBNDef.OverrideIcon = oCNRes

oApp.ActiveView.Update

End Sub&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 May 2022 08:23:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-change-custom-icon-to-gray-in-browser-pane-when-set-its/m-p/11146535#M137681</guid>
      <dc:creator>Ralf_Krieg</dc:creator>
      <dc:date>2022-05-04T08:23:44Z</dc:date>
    </item>
    <item>
      <title>Re: how to change custom icon to gray in browser pane when set its visibility to false?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-change-custom-icon-to-gray-in-browser-pane-when-set-its/m-p/11146539#M137682</link>
      <description>&lt;P&gt;Thanks Krieg!! Gonna try it out tonight! Guess its time to install 2022/23..&lt;/P&gt;</description>
      <pubDate>Wed, 04 May 2022 08:25:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-change-custom-icon-to-gray-in-browser-pane-when-set-its/m-p/11146539#M137682</guid>
      <dc:creator>basautomationservices</dc:creator>
      <dc:date>2022-05-04T08:25:04Z</dc:date>
    </item>
    <item>
      <title>Re: how to change custom icon to gray in browser pane when set its visibility to false?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-change-custom-icon-to-gray-in-browser-pane-when-set-its/m-p/11146916#M137694</link>
      <description>&lt;P&gt;&lt;SPAN class=""&gt;&lt;A href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/10337235" target="_self"&gt;&lt;SPAN class=""&gt;basautomationservices&lt;/SPAN&gt;&lt;/A&gt;&lt;/SPAN&gt; and &lt;SPAN class=""&gt;&lt;A href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/564136" target="_self"&gt;&lt;SPAN class=""&gt;krieg&lt;/SPAN&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I use Inventor 2019. The white area of the icon is transparent. I think it should work in dark mode.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I found another article &lt;A href="https://adndevblog.typepad.com/manufacturing/2012/12/inventor-displaystate-property-of-browsernodedefinition.html" target="_blank" rel="noopener"&gt;https://adndevblog.typepad.com/manufacturing/2012/12/inventor-displaystate-property-of-browsernodedefinition.html&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I anticipate the solution for changing icon with respect to adaptive or visibility or transparency hints on how to use something like:&lt;/P&gt;&lt;P&gt;...Set nativeObj = nodeDef.NativeObject&lt;/P&gt;&lt;P&gt;...occ.Adaptive&lt;/P&gt;&lt;P&gt;...oClientFeature.BrowserNode.BrowserNodeDefinition.OverrideIcon = ocnr&lt;/P&gt;&lt;P&gt;There should be solution to stitch them together&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 May 2022 12:16:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-change-custom-icon-to-gray-in-browser-pane-when-set-its/m-p/11146916#M137694</guid>
      <dc:creator>liminma8458</dc:creator>
      <dc:date>2022-05-04T12:16:47Z</dc:date>
    </item>
  </channel>
</rss>

