• This forum is the machine-generated translation of www.cad3d.it/forum1 - the Italian design community. Several terms are not translated correctly.

new toolbar

  • Thread starter Thread starter strudeldemele
  • Start date Start date

strudeldemele

Guest
Good morning to all,
I was wondering if you can create a new custom toolbar in sw 2017 without using an existing toolbar
thanks for the collaboration
Good day to all
 
...I was just looking for the way to insert it through add-in; Can you pass me the vba program to be able to insert ad-hoc toolbars?
I explain: I should interface with sw2017 an internally created management, and I would need to insert more bars of the appropriate tools.
Thank you for your kind collaboration.
good work at all
 
Hi.

I appeal to this discussion to know if you have found the source code of the custom bar in c#.

I am trying to create one within a custom add, following the various online guides I can make it work more or less everything. I have a problem to solve. I can't get the custom icons I made.

would you have the implementation of icons for menus in c#?
 
would you have the implementation of icons for menus in c#?
if in creating your addin you started from the template included in the sdk, the one that should appear as swcsharpaddin, you already have everything.

if it does not work can depend on the fact that within your project the image you used has the wrong properties.
check if the compilation action is like the default image of the template.
 
I didn't use sdk. I rewrite it, copying it more or less, from the help bees of sw.
what I can't do is set icons and mainiconlists. I can't make the icons appear instead of the blue ball with the i. The rest is ok...
 
I didn't use sdk. I rewrite it, copying it more or less, from the help bees of sw.
what I can't do is set icons and mainiconlists. I can't make the icons appear instead of the blue ball with the i. The rest is ok...
What version of visual study do you use?
 
vs 2017..

I believe that the implementation of icons in paragraphng menager takes place here:

cmdgroup = icmdmgr.createcommandgroup2(maincmdgroupid, title, tooltip, "", -1, ignorantprevious, ref cmdgrouperr);

icons[0] = @"multi_ico20";
icons[1] = @"multi_ico32";
icons[2] = @"multi_ico40";
mainicons[0] = @"ico_20";
Mainicons[1] = @"ico_32";
Mainicons[2] = @"ico_40";

cmdgroup.iconlist = icons;
cmdgroup.mainiconlist = mainicons;

int menutoolbaroption = (int)(swcommanditemtype_e.swmenuitem | swcommanditemtype_e.swtoolbaritem);

cmdgroup = icmdmgr.createcommandgroup(1, "addin", "funzionalità personalizzate", "", 3);

cmdindex0 = cmdgroup.addcommanditem2("xxx", 0, "xxx", "xxx", 0, "_metodo1", "", mainitemid1, menutoolbaroption);
cmdindex1 = cmdgroup.addcommanditem2("xxx", 1, "xxx", "xxx", 1, "_metodo2", "", mainitemid2, menutoolbaroption);
cmdindex2 = cmdgroup.addcommanditem2("xxx", 2, "xxx", "xxx", 2, "_metodo3", "", mainitemid3, menutoolbaroption);

cmdgroup.hastoolbar = true;
cmdgroup.hasmenu = true;
cmdgroup.activate();

bool bresult;

flyoutgroup = icmdmgr.createflyoutgroup2(flyoutgroupid, "dynamic flyout", "dynamic flyout", "flyout hint", mainicons, icons, "flyoutcallback", "flyoutenable");

come da pagina di sw:
http://help.solidworks.com/2017/eng...outs_in_the_commandmanager_example_csharp.htm
 
the implementation of images is not only in the code. must also be included in the project.

If you have installed the solidworks sdk bee, this installs the addin template. Unfortunately, it does not create it in the right place for vs2017.

I'll get you the template. put the file as it is in documents\visual studio 2017\templates\projecttemplates\visual c#

If you create a project from this you see all the details, so you can replicate them in yours.
 

Attachments

Forum statistics

Threads
44,997
Messages
339,767
Members
4
Latest member
ibt

Members online

No members online now.
Back
Top