Inventor Customization

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

Using My.Resources to get a button icon

165 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
Posts: 89
Registered: ‎09-13-2012
Message 2 of 2 (134 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.
Software in use: Inventor 2014, SolidWorks 2011
Also experience with: Solid Edge untill ST4,

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 interested in helping shape the Autodesk Community?
We’re looking at a few different ways to improve the “All Forums” landing page and need your feedback! If interested, please take a few minutes to fill out the following Usability Study. Thank you for your time!

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