AnsweredAssumed Answered

Addins Bitmaps

Question asked by Ben Guenther on Aug 7, 2009
Latest reply on Nov 18, 2009 by Luke Malpass

I know that there are several posts about people having issues with getting the bitmaps to work but I could not get a strait answer out of any of them. So i decided to make my own post.


I started off with the addin template that you can get from solidworks web site.


This is the code for getting the image paths as strings.




cmdGroup = iCmdMgr.CreateCommandGroup(1, Title, ToolTip, "", 3)

cmdGroup.LargeIconList = iBmp.CreateFileFromResourceBitmap("AssemblyPricing.ToolbarLarge.bmp", thisAssembly)

cmdGroup.SmallIconList = iBmp.CreateFileFromResourceBitmap("AssemblyPricing.ToolbarSmall.bmp", thisAssembly)

cmdGroup.LargeMainIcon = iBmp.CreateFileFromResourceBitmap("AssemblyPricing.MainIconLarge.bmp", thisAssembly)

cmdGroup.SmallMainIcon = iBmp.CreateFileFromResourceBitmap("AssemblyPricing.MainIconSmall.bmp", thisAssembly)


And everything was working good until I tried to insert my own pictures then it stopped working. I even tried to switch it back to the original way with original pictures, and nothing. cmdGroup.... always comes back "". I have played with that for like a long time and nothing just cant get it to work.


So then after reading a few posts and some more playing I realized that it worked to just do this:




cmdGroup = iCmdMgr.CreateCommandGroup(1, Title, ToolTip, "", 3)

cmdGroup.LargeIconList = "C:\Documents and Settings\LM Cad\My Documents\LM-SoftWorks\ToolbarLarge.bmp"

cmdGroup.SmallIconList = "C:\Documents and Settings\LM Cad\My Documents\LM-SoftWorks\ToolbarSmall.bmp"

cmdGroup.LargeMainIcon = "C:\Documents and Settings\LM Cad\My Documents\LM-SoftWorks\MainIconLarge.bmp"

cmdGroup.SmallMainIcon = "C:\Documents and Settings\LM Cad\My Documents\LM-SoftWorks\MainIconSmall.bmp"


Is there anything wrong with my last example that I should not do it that way ?

Why does the first example cause so much trouble ?

What is the main reason people cant get the first example to work ?