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 ?
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,
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
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,
Nacho
Automation & Design Engineer
Inventor Programmer (C#, VB.Net / iLogic)
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.