Inventor Customization

Reply
Distinguished Contributor
Thomas.Rambach
Posts: 571
Registered: ‎07-22-2004
Message 1 of 2 (193 Views)
Accepted Solution

Using My.Resources to get a button icon

193 Views, 1 Replies
01-23-2014 08:49 AM

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.

Valued Contributor
VdVeek
Posts: 101
Registered: ‎09-13-2012
Message 2 of 2 (162 Views)

Re: Using My.Resources to get a button icon

01-24-2014 02:38 PM in reply to: Thomas.Rambach

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 2012 Certified Associate & Autodesk Inventor 2012 Certified Professional.

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community


Inventor Exchange Apps

Created by the community for the community, Autodesk Exchange Apps for Autodesk Inventor helps you achieve greater speed, accuracy, and automation from concept to manufacturing.

Connect with Inventor

Twitter

Facebook

Blogs

Pinterest

Youtube