×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Custom Toolbar
7

Custom Toolbar

Custom Toolbar

(OP)
Hello all,

I was wondering if there was a way of adding a new entirely empty toolbar? I suppose I could add one we don't use and empty it, but it would be nice to add a nice blank one with our own title. We're running 2009sp2.0 if it makes a difference.

Any Ideas?

Thanks

RE: Custom Toolbar

5
You can use command Tabs Instead of toolbars. You can create new command tab within the customization environment and place commands to it.

As for the toolbars. You can create your own toolbar with your own title, icon etc using SolidWorks API (SldWorks::AddToolbar4 method or with the command manager APIs)

Artem Taturevich
CSWP

RE: Custom Toolbar

(OP)
I don't use the command manager in my setup, but I'll give that API a go, thanks

RE: Custom Toolbar

2
I believe that this can only be done in an Add-in, not in a plain macro or an exe file.  Also, I don't believe the toolbar will persist from session to session.  Basically, if you want to make your own toolbar like that you'll have to create an add-in.  I'm pretty sure that, once created, that toolbar will not be customizable by the SW interface either.  All commands will have to be added in code.

-handleman, CSWP (The new, easy test)

RE: Custom Toolbar

handleman,

You are right with the Add-in. But it is easy to do (with the standard VS SW template). It is also possible to disable the addin's menus, PMP, command managers etc and keep just the toolbar.

BTW. It is possible to edit this toolbar as well as standard ones: you can add or remove buttons from it within the customization environment.

And these setting will persist from session to session (they stored in the registry).

Artem Taturevich
CSWP

RE: Custom Toolbar

Not everyone has VS.  I don't.

So all you have to do to create a new toolbar is use the add-in to create the toolbar once, and it exists in SW forever, whether or not the add-in is active or not?  And it behaves/customizes just like any other toolbar?  If so, could you create a little add-in that does nothing but create a toolbar with whatever the user specifies in an InputBox or something?

-handleman, CSWP (The new, easy test)

RE: Custom Toolbar

Hello Handleman,

Please find the sample addin in the attachment.

You should open the dll-file from the menu File->Open, set filter to "add-ins (*.dll)". Once you have loaded it you can select it from the tollbars list.

You can customize it and add standard button from another toolbar (please take a look at the attached picture).

BTW. I haven't mentioned about the toolbar visibility with add-in unloaded. It will be removed once the add-in unloads. But I believe it isn't a problem just set "Load on start-up" option to add-in automatically loads with the new session of SolidWorks.

Thanks,
Artem

Artem Taturevich
CSWP

RE: Custom Toolbar

Thanks, Artem!  

Unfortunately, I can't seem to get it to work.  I opened the .dll file in the File->Open dialog, but it did not seem to do anything.  I didn't get any error messages or anything, but it doesn't appear in the Add-ins list under Tools->Add-Ins, and the custom toolbar doesn't appear in the list of toolbars.

-handleman, CSWP (The new, easy test)

RE: Custom Toolbar

handleman,

The issue is probably a dependancy on one of the Visual Studio runtime dlls.  If Artem can tell you which version of Visual Studio was used to compile the dll, you can download the corresponding redistributable from Microsoft.

Eric

RE: Custom Toolbar

I think Eric right. I've used VS 2005 to compile the dll.

handleman, please download the Visual Studio redistributable from Microsoft web site. (the add-in name is "SwCustToolbar")

Thanks,
Artem

Artem Taturevich
CSWP

RE: Custom Toolbar

handleman, what version of SolidWorks do you use?

As I know the redistributable from Microsoft was required on SolidWorks 2007 and earlier but in newer version it might be not obligatory but I'm not sure...

Artem Taturevich
CSWP

RE: Custom Toolbar

Hello Matt,

Yes, that is in c++.

I've written and tested this addin on two workstations with SolidWorks 2009. Probably some of the APIs I have used isn't presented in SolidWorks 2007.

Thanks,

Artem Taturevich
CSWP

RE: Custom Toolbar

Hello,

I have recreated this sample addin in c# with the libraries from SolidWorks 2007 and created the installer.

Once the addin installed you can open it from the File->Open menu and choose "SwCSharpCustTB.dll" file from installation directory. The "SwCustTB" toolbar should appears under the toolbars menu.

Thanks

Artem Taturevich
CSWP

RE: Custom Toolbar

Artem,

Thanks once again for your work on this.  This time I was able to install the Add-In and the toolbar appears in my SW session each time I start SW.  I am able to add/remove buttons from the new toolbar, but they do not persist from session to session.  Every time I start SW only that first default button shows up.  Is that the behavior you get on your test machines?

-handleman, CSWP (The new, easy test)

RE: Custom Toolbar

Hello Handleman,

No I have different behavior. The customozation remains from session to session.

I have tried different combinations: adding buttons from Command menu, drag-n-drop buttons from another toolbar. Unloading addins from the menu, shutting down SolidWorks and reopening it. Every time I have my toolbar costumized.

I have tested it in SolidWorks 2009. Probably there is some another behaviour with another versions of SolidWorks.

Do you have your addin set to "Load on start up". Or you have reloadin it each session? And what version of SolidWorks do you use?

Thanks,

Artem Taturevich
CSWP

RE: Custom Toolbar

I'm running 2009 SP 3.0.  The add-in is set to load on startup.

-handleman, CSWP (The new, easy test)

RE: Custom Toolbar

Please try to drag-n-drop the button from anoter toolbar to custom one. So it is removed from standard toolbar and added to custom toolbar.

Next close/open SolidWorks. Does this button back to it original toolbar?

Thanks,
Artem

Artem Taturevich
CSWP

RE: Custom Toolbar

I dragged the "Boss-Extrude" button from the standard "Features" toolbar to the custom one so that the button was no longer on the "Features" toolbar.  After closing and reopening SolidWorks, the button was still missing from the "Features" toolbar, but was not present on the custom one.

-handleman, CSWP (The new, easy test)

RE: Custom Toolbar

This is really strange behavior. Have you a chance to look this issue with different workstation?

Could please you also try to unload/load addin within the current session? Has the button been removed from the toolbar as well?

Artem Taturevich
CSWP

RE: Custom Toolbar

Excellent job Artemtat, SW users have been asking for something like this for YEARS!  

It installed at: C:\Program Files\Default Company Name\SwCSharpCustTBInstall

Opened this: SwCSharpCustTB.dll

Right-clicked a button > customize and picked SwCustTB



After turning it on, just go to Commands in the Customize dialog box and drag and drop from there, no need to remove icons from existing toolbars unless you want to.


I'm using SW09 SP 3.0, and I can close SW and restart it and it remembered my buttons I dragged on there.


 

Flores

RE: Custom Toolbar

So, I still didn't get it to work, and my efforts actually crashed SW, so I'll skip this attempt until I'm looking at 2009 on my screen.  I am wondering though, now that they added the S on-screen toolbar, why would this functionality be needed in 2009?  There are some examples where individuals have completely eliminated the toolbars and just use S.

Matt Lorono
CAD Engineer/ECN Analyst
Silicon Valley, CA
Lorono's SolidWorks Resources
Co-moderator of Solidworks Yahoo! Group
and Mechnical.Engineering Yahoo! Group

RE: Custom Toolbar

To be honest, I don't really need this functionality myself either.  However, as others have said, this has been asked for in the past.  Personally, since I never design molds, I took the "Mold Tools" toolbar, stripped it bare, and then added my own stuff to it.  The toolbar name is never displayed unless you un-dock it, so I don't really care what it's called either.

I have way too many macro buttons to get rid of toolbars entirely.  Certain macros don't run well from the "S" popup.

-handleman, CSWP (The new, easy test)

RE: Custom Toolbar

(OP)
That would be an interesting experiment, although I do seem to use a huge amount of different commands, so I'm not sure it would work for me.

My reasoning behind wanting this was that a few of my collegues and I have put together some macros for automation and we would like to be able to install them in a company specific toolbar to all the users here.

I think I'm now leaning toward having just one button that brings up a second VB based dialog with all the available commands on that, but I'm quite happy I seem to have started something that looks useful to others

RE: Custom Toolbar

Steve,
You may want to look into SWTools from AngelSix.com.  Go to the "Products" page and click "Free Products".   

-handleman, CSWP (The new, easy test)

RE: Custom Toolbar

(OP)
Thaks, I'll take a look

RE: Custom Toolbar

Quote:

I'm now leaning toward having just one button that brings up a second VB based dialog with all the available commands on that
Try Lenny's MacroLaunch.

http://www.lennyworks.com/solidworks/default.asp?ID=20

Joe
SW Office 2008 SP5.0
P4 3.0Ghz 3GB
ATI FireGL X1

RE: Custom Toolbar

Thanks Artem. A star from me as well.

RE: Custom Toolbar

Thank you, dogarila,

If this simple application can be useful for users I can take out the addin the generation of the name and the icon for toolbar. So everyone can set name and icon as he like.

If you need this please answer.

Artem Taturevich
CSWP

RE: Custom Toolbar

ArtemTat ... Obviously users are finding your Custom Toolbar very useful. Would you mind creating an FAQ for easier reference and for future users to discover?

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources