INVENTOR ICONS

INVENTOR ICONS

GosponZ
Collaborator Collaborator
293 Views
4 Replies
Message 1 of 5

INVENTOR ICONS

GosponZ
Collaborator
Collaborator

Does anybody know or have those .ipt, .iam icons or how to get them?

0 Likes
Accepted solutions (1)
294 Views
4 Replies
Replies (4)
Message 2 of 5

WCrihfield
Mentor
Mentor

I believe you would first have to find/get the ControlDefinition using them.  Then use its ControlDefinition.LargeIcon and ControlDefinition.StandardIcon properties to access the 'IPictureDisp' object.  Your code should be 'referencing and importing' the "stdole" source, where the IPictureDisp Type is defied, and the System.Drawing source.  Then you would need to convert that data type to the System.Drawing.Image data type, using a custom Class that 'Inherits' from the System.Windows.Forms.AxHost Class, and contains methods for converting between the two data types.  Then save the Image out as a bmp or png type file.  Years ago, I used to use a VBA macro for this type of task, but it used resources and methods which may now be outdated.

AxHost.GetIPictureDispFromPicture 

AxHost.GetPictureFromIPictureDisp 

I believe the ControlDefinitions you may be interested in are the ones under the 'File' menu, and the 'New' sub category.  Those can be a bit odd to find.  I believe they are named:

"NewFileTemplate5" (presentation)
"NewFileTemplate4" (part)
"NewFileTemplate2" (drawing)
"NewFileTemplate1" (assembly)

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 3 of 5

jjstr8
Collaborator
Collaborator

I've gotten a component's icon from the native browser node definition of its model browser pane top node. The Icon property returns an IPictureDisp object which you can then use it's Handle to stream it to another type of image. I was creating a BitmapImage for use in WPF windows. I liked that it was an icon based on the document sub-type; weldment, sheet metal, etc.

BrowserPanes.GetNativeBrowserNodeDefinition Method 

NativeBrowserNodeDefinition.Icon Property

 

Unfortunately for me the browser icon changed based on light or dark theme and I was trying to use them on a white background. I ended up screenshotting Windows Explorer to get the document icons. If you use a folder with a lot of Inventor documents in it you can catch it before they're replaced with thumbnails. You only get the style of icon Explorer uses, but that worked for me.  It's also nice to get the icons in different sizes. I tried to figure out what dll they're stored in, but I gave up looking after a while. @WCrihfield - I'll have to look into what you did. I never thought to do it that way.

0 Likes
Message 4 of 5

mateusz_baczewski
Advocate
Advocate
Accepted solution

@GosponZ 

 

Hello,

There’s a small application for extracting icons from .dll files. If you need a specific icon, download the app from GitHub. The application is called BeCyIconGrabberPortable. After selecting the .dll file, you can find the icon you’re interested in and save it.

 

mateusz_baczewski_0-1752563271497.png

 

 

I’ve also attached the Part and Assembly icons.

 

If you found it helpful, a "Like" would be much appreciated!
If this post solved your problem, please mark it as "Solution.".

Message 5 of 5

WCrihfield
Mentor
Mentor

Hi @jjstr8.  When looking at the bottom of the webpage for the official online help for those two methods I mentioned, it looks like it may be limited to VB.NET Framework and Windows Desktop stuff.  Since I am still using Inventor Pro 2024.3.5, and I have been using it from iLogic rules, which still use vb.net framework, it still works just fine for me.  However, if you have Inventor 2025, 2026, or newer, and may be trying to use it in something like an add-in, it may not work, but I can not be sure yet myself.  It seems like I have heard about some folks starting to use a newer way to convert or translate between these picture data types, for use in their .Net 8+ add-ins, but I do not recall the details or links to them.

Below are a few additional Links that I did keep on hand, which may be interesting reads for those finding this discussion later.

You contributed an accepted solution in the second Link below also, just after a couple of my posts on the subject.  There are also some information Links within the posts in those discussions.

https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogicmini-toolbar-combo-box-list-item-ic... 

https://forums.autodesk.com/t5/inventor-programming-ilogic/get-the-thumbnail-from-active-inventor-do... 

https://forums.autodesk.com/t5/inventor-programming-ilogic/copy-thumbnails-from-files-in-directory-t... 

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes