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: 

Access inventor button icon

4 REPLIES 4
Reply
Message 1 of 5
TheCarl
395 Views, 4 Replies

Access inventor button icon

I am trying to build a treenode imagelist with some button icons.  I have a been able to convert an IpictureDisp to image.  So if I convert an image to a IPictureDisp, I can convert it back to an image.  However, if I try to get the icon as IpicturDisp (.StandardIcon) through a command control definition, it does not work.  Can we access the icon after the button has been defined and how ?

4 REPLIES 4
Message 2 of 5
adam.nagy
in reply to: TheCarl

Hi,

 

Are you trying to do that from an AddIn or from outside another exe?

If the latter, then that will probably not work:

http://forums.autodesk.com/t5/Inventor-Customization/Error-adding-image-to-ImageSet/td-p/3271651

 

Cheers,



Adam Nagy
Autodesk Platform Services
Message 3 of 5
TheCarl
in reply to: adam.nagy

Hi Adam,

 

              I am doing this with an VB.net addin - on Windows 7 on a 64 bit machine - Inventor 2015.

 

 I can access the .StandardIcon property for the button, splitbutton, splitbutton MRU and popup button control definitions but when I am trying to get the icon from a Toggle Pop-up control I get an error.  I have simplified my code to in the following manner so it is maybe easier to understand what I am doing wrong :

 

    Sub GetIcon(ByVal oCommand As Inventor.ControlDefinition)

 

        ...

 

        If oCommand.ControlType = ControlTypeEnum.kTogglePopupControl Then

            Dim oIcon As stdole.IPictureDisp

            oIcon = oCommand.StandardIcon  ' ****  This will generate the error #91 : object variable not defined

        End If

 

        ...

 

    End Sub

 

 

Thanks

Message 4 of 5
adam.nagy
in reply to: TheCarl

Hi Carl,

 

It seems that not all Ribbon items have a valid control definition object, and even if they do they might not provide an icon - I guess because they are not a real ControlDefinition, they are just placeholders, not associated to a command that could actually be run.

http://adndevblog.typepad.com/manufacturing/2014/07/get-ribbon-images.html

 

Cheers,

 



Adam Nagy
Autodesk Platform Services
Message 5 of 5
NachitoMax
in reply to: adam.nagy

Hi

Funnily nough, I came across this about 3 minutes before seeing your post. NOTE: I wasn't looking to do this, just saw a post and looked at it out of interest.

Anyway, this might help 🙂

http://adndevblog.typepad.com/manufacturing/2014/07/get-ribbon-images.html

Nige

Nacho

Automation & Design Engineer

Inventor Programmer (C#, VB.Net / iLogic)


EESignature


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.


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

Post to forums  

Autodesk Design & Make Report