Hello,
i change Icons on AutoCAD 2014 from ribbons an toolbars to display any stats.
Now i must change to AutoCAD 2017 with transparent PNG-files. Change the ribbon-icons are works fine, but when i change the ToolbarButtons crashed the function IAcadToolbarItem.SetBitmap(...) with:
System.ArgumentException Source Autodesk AutoCAD Civil 3D 2017
Ungültiges Argument C:\Program Files\Autodesk\ApplicationPlugins\KSRO_ChangeOSNAP.bundle\Contents\CUI\KSRO_OSNAP_POINT_16_OFF.PNG in SetBitmap ==>>
bei Autodesk.AutoCAD.Interop.IAcadToolbarItem.SetBitmaps(String SmallIconName, String LargeIconName)
What is the correct way on AutoCAD2017 to change ToolbarIcon?
SetToolbarIcon-code
public static Boolean changeToolbarIcon(String cuiName, String toolbarName, String buttonName,
String newSmallIconFileName, String newLargeIconFileName)
{
Boolean result = false;
IAcadApplication iApp = (IAcadApplication)Autodesk.AutoCAD.ApplicationServices.Application.AcadApplication;
try
{
foreach (IAcadToolbarItem iAcadToolbarItem in ((IAcadToolbar)((IAcadMenuGroup)iApp.MenuGroups.Item(cuiName)).Toolbars.Item(toolbarName)))
{
if ((iAcadToolbarItem.TagString == buttonName) || (iAcadToolbarItem.Name == buttonName))
{
iAcadToolbarItem.SetBitmaps(newSmallIconFileName, newLargeIconFileName);
result = true;
break;
}
}
}
catch (Exception ex)
{ Log.LogException(ex, "ZusatzInfo: Buttonname[" + buttonName + "], newSmallIconFileName[" + newSmallIconFileName + "], newLargeIconFileName[" + newLargeIconFileName + "]"); }
return result;
}
regards Mario