Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

change browser folder icon

7 REPLIES 7
Reply
Message 1 of 8
saseendrankombath
825 Views, 7 Replies

change browser folder icon

is it possible to change browser folder icon?

7 REPLIES 7
Message 2 of 8

Hi,

 

I'm not sure I understand the question. The folder icon of what and where exactly?

 

I think it would be useful to provide an image of what the current situation is vs. what you'd like to get.

 

Cheers,



Adam Nagy
Autodesk Platform Services
Message 3 of 8

Please find attached, The browser folder inside assembly document, To replace the standard icon with a custom icon

Message 4 of 8

Hi,

 

Changing the icon of a native browser node is similar to setting the icon of your own panel's client node, but you work with NativeBrowserNodeDefinition and set the OverrideIcon property instead.

Sub ChangeIcon()
    Dim bps As BrowserPanes
    Set bps = ThisApplication.ActiveDocument.BrowserPanes

    ' e.g. if you want to change the root node's icon
    ' in the assembly "Model" panel
    Dim bp As BrowserPane
    Set bp = bps("AmBrowserArrangement")
        
    Dim bmp As IPictureDisp
    Set bmp = LoadPicture("C:\Bitmap1.bmp")
        
    Dim cnr As ClientNodeResource
    ' Only Bitmaps are supported by the Add method
' and it should be 16x16 Set cnr = bps.ClientNodeResources.Add( _ "MyResource", 2, bmp) Dim nbnd As NativeBrowserNodeDefinition Set nbnd = bp.TopNode.BrowserNodeDefinition nbnd.OverrideIcon = cnr End Sub

I hope this helps.

 

Cheers,



Adam Nagy
Autodesk Platform Services
Message 5 of 8

Gives Add Method Error. See Attachment

Message 6 of 8

Hi,

 

I believe this code is unlikely to succeed on 64-bit because VBA is running out of process. You would need either to use 32-bit VBA or try the same from a VB.Net/C# add-in. The way to load resources if different however in .Net.

 

You can refer to the following articles:

 

hhttp://adndevblog.typepad.com/manufacturing/2012/06/how-to-convert-iconbitmap-to-ipicturedisp-witho...

 

http://adndevblog.typepad.com/manufacturing/2012/08/change-the-browser-node-icon.html

 

Regards,

Philippe.



Philippe Leefsma
Developer Technical Services
Autodesk Developer Network

Message 7 of 8
MjDeck
in reply to: saseendrankombath

Attached is an iLogic rule that will work for an assembly or part document.


Mike Deck
Software Developer
Autodesk, Inc.

Message 8 of 8

Thanks

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report