Message 1 of 6
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi
My Inventor 2024 addin uses the following to put a button with an icon on the toolbar.
stdole.IPictureDisp standardIconIPictureDisp = null;
stdole.IPictureDisp largeIconIPictureDisp = null;
if (standardIcon != null)
{
#pragma warning disable CS0618 // Type or member is obsolete
standardIconIPictureDisp = Support.IconToIPicture(standardIcon) as stdole.IPictureDisp;
largeIconIPictureDisp = (stdole.IPictureDisp)Support.IconToIPicture(largeIcon);
#pragma warning restore CS0618 // Type or member is obsolete
}
mButtonDef = AddinGlobal.InventorApp.CommandManager.ControlDefinitions.AddButtonDefinition(
displayName, internalName, commandType,
clientId, description, tooltip,
standardIconIPictureDisp, largeIconIPictureDisp, buttonDisplayType);
However this does not work with Inventor 2025 as .NET no longer supports Microsoft.VisualBasic.Compatibility.VB6 which provides the Support.IconToIPicture function.
Thanks
Paul
Solved! Go to Solution.