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: 

Using My.Resources to get a button icon

1 REPLY 1
SOLVED
Reply
Message 1 of 2
Anonymous
528 Views, 1 Reply

Using My.Resources to get a button icon

The Inventor API helps shows this for defining a button icon:

 

Dim oControlDefinitions As ControlDefinitions
Set oControlDefinitions = oApp.CommandManager.ControlDefinitions

Dim oLargeIcon As IPictureDisp
Dim oSmallIcon As IPictureDisp
Set oLargeIcon = LoadPicture(App.Path & "\Large.ico")
Set oSmallIcon = LoadPicture(App.Path & "\Small.ico")

Set oButtonDefinition = oControlDefinitions.AddButtonDefinition( _
  "Display Name", "invrSampleCommand", _
  kShapeEditCmdType, "CLSID of the AddIn", _
  "Description Text", "Tooltip", _
  oSmallIcon, oLargeIcon, _
  kDisplayTextInLearningMode)

 

But how would I use My.Resources to assign the button icon? 

Microsoft.VisualBasic.Compatibility.VB6.IconToIPicture isn't supported anymore.

1 REPLY 1
Message 2 of 2
VdVeek
in reply to: Anonymous

Thomas, This is working for me when i use an addin wizard in Visual Basic 2010 Express :

Dim image1 As New Bitmap(Assembly.GetExecutingAssembly().GetManifestResourceStream("vdv.bmp"))

Dim progImage As IPictureDisp
progImage = InventorButton.ImageToPicture(image1)

 

Rob.

Autodesk Inventor 2015 Certified Professional & Autodesk Inventor 2012 Certified Professional.

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

Post to forums  

Autodesk Design & Make Report