Difficulty adding resources to .NET8 type Inventor Addin

Difficulty adding resources to .NET8 type Inventor Addin

JBerns
Advisor Advisor
137 Views
2 Replies
Message 1 of 3

Difficulty adding resources to .NET8 type Inventor Addin

JBerns
Advisor
Advisor

Curtis ( @Curtis_Waguespack  ) / Community,

 

I am building a custom addin for Inventor 2025 and encountered difficulties adding button icon resources.


I used the 'Addin Basic Template' from your AU Class:

Bridging the Gap Between iLogic Automation and Inventor Add-Ins 

 

I updated the project for Inventor 2025, .NET8 compatibility.
Your add-in was working for the ZeroDoc, Assembly, and Drawing Environments.

 

Next, I copied the Detect_Dark_Light_Theme.vb code to create my custom button. Also copied necessary code in StandardAddInServer.vb to add my custom button. I added my button icons (PNGs) to the Resources folder. I updated the copied VB code to reference my custom button icons.

 

However, when starting Inventor (loading the addin), this error appears related to the line in PictureConverter:

 Me.hbitmap = bitmap.GetHbitmap()

'Object reference not set to an instance of an object.'

 

When I referenced your icons for my buttons, the addin worked without errors.

 

I discovered I had to manually edit the Resouces.resx file to add my custom icons to the project/assembly.

 

JBerns_0-1753803064316.png

 

The addin works now with my custom button and icon.

 

Have you or others encountered this resource difficulty for .NET8 type Inventor addins?

 

Thank you for your time and attention. I look forward to your reply.

 


Regards,
Jerry

-----------------------------------------------------------------------------------------
CAD Administrator
Using AutoCAD & Inventor 2025
Autodesk Certified Instructor
Autodesk Inventor 2020 Certified Professional
Autodesk AutoCAD 2017 Certified Professional
0 Likes
138 Views
2 Replies
Replies (2)
Message 2 of 3

JBerns
Advisor
Advisor

Just discovered how to edit the project resources (.resx) using the updated VS2022 interface.

 

The 'Show All Files' option had been disabled in the Solution Explorer. This prevented seeing the Resources.resx file in the My Project folder. 

JBerns_0-1753807786127.png

Once the option was enabled, the Resources.resx file was visible in the My Project folder. 

JBerns_1-1753807846563.png

 

Double-click the Resources.resx file in the My Project folder to open the editor. From here, the images could be added to the project. Adding here is required. It is not sufficient to just add the button icons to the Resources folder.

 

JBerns_2-1753807936089.png

 

I hope this helps others that may be struggling with the process of adding project resources for their custom ribbon buttons.

-----------------------------------------------------------------------------------------
CAD Administrator
Using AutoCAD & Inventor 2025
Autodesk Certified Instructor
Autodesk Inventor 2020 Certified Professional
Autodesk AutoCAD 2017 Certified Professional
Message 3 of 3

Curtis_Waguespack
Consultant
Consultant

@JBerns , as mentioned elsewhere... but in case it helps others... I set the resource editor back to the old one:

https://stackoverflow.com/questions/78983001/is-there-a-way-to-make-the-legacy-resx-editor-the-defau...

 

Learning to work with the new one is probably the better approach, I just have not had the chance to much in VS as of late.

EESignature