Image in Add-On

Hi there!

Is there a way to add an image in an add-on that was created with Python? I would like to have something similar to the Measure widget, see attached screenshot.

Thanks!

No. You would need to implement it with the .NET API.

If you could accept that the image is not directly on the add-on dialog, there is a workaround. You could add a “Help” or “Explanation” button. Something like this.

from vcCommand import *
from vcHelpers.Application import *
import os, subprocess

def OnHelp(arg):
  rootFolder = getCommandPath().split("\\")[:-1]  
  rootFolder.append("Help.png")
  imagePath = "\\".join(rootFolder)
  os.startfile(imagePath) # Call user's default image viewer
 
def OnStart():  
  global diag 
  diag = getDialog("HelpDemo")
  help = diag.addProperty("Help", VC_BUTTON, OnHelp)
  diag.show()