CAD+ Toolset (Beta) | Utilities for SOLIDWORKS automation
SOLIDWORKS utilities for improving your productivity in SOLIDWORKS. Automate properties, geometry, export and much more

Download

Configuring macro buttons in Custom Toolbar add-in for SOLIDWORKS


Adding Macro Buttons And Toolbars

Macro buttons can be configured by clicking on 'Configure...' command in Custom Toolbar menu in SOLIDWORKS

Custom Toolbar add-in menu in SOLIDWORKS
Custom Toolbar add-in menu in SOLIDWORKS

  1. Custom Toolbar sub-menu in SOLIDWORKS Tools menu
  2. Button to configure toolbar

Configuration dialog is displayed and existing toolbar and buttons can be modified as well as new can be added.

Click on green plus (+) button to add new toolbar or macro button.

Configure the parameters as shown below:

Configuring Macro Buttons In Toolbar

Editing macro button in Custom Toolbar
Editing macro button in Custom Toolbar

  1. Path to toolbar file. This setting is stored locally to the user. UNC path is supported if required to configure a shared toolbar
  2. Add new toolbar
  3. Add new macro button in toolbar
  4. Title of the macro button. It displayed as a bold header in the tooltip when mouse hovers a button in SOLIDWORKS toolbar
  5. Description of the macro button. It displayed as a sub-header in the tooltip and in the SOLIDWORKS task bar in the bottom right corner when mouse hovers a button in SOLIDWORKS toolbar
  6. Path to icon of the macro button. Optimal size is between 16x16 and 120x120 in PNG format, however image will be automatically scaled and aligned which allows support for any size (including different width and height). Transparency is supported.
  7. Full path to macro to run
  8. Macro entry point. This is the subroutine which should be run first when executing the macro. This is a parameterless subroutine (usually named main). Custom Toolbar will try to automatically find the best suitable subroutine
  9. Triggers. Macro trigger options. Follow triggers article for more information
  10. Command scope. Identifies the scope (part, assembly, drawing, no documents) where macro can be run. Macro will be disabled in the not selected environments
  11. Command location. Identifies where command should be added (menu, toolbar). This option is only available for Button and Toggle Button triggers
  12. Toggle Button State Code group - options for handling the state of toggle button if Toggle Button trigger is specified. Follow Toggles article for more information.
  13. Unload After Run. If option is checked macro will be automatically unloaded after run. This option is useful when macro is shared across different users. In this case macro wil lbe released immediately enabling the possibility to replace the macro with new version. This option cannot be used if macro displays User Form as in this case it will be immediately unloaded and form will be closed. Untick this option if macro uses User Form or any other popup Window.

Configuring Toolbar

Editing toolbar in Custom Toolbar
Editing toolbar in Custom Toolbar

  1. Toolbar title to be displayed in the SOLIDWORKS toolbars manager
  2. Toolbar tooltip
  3. Toolbar icon
  4. Preview of toolbar icon (default icon)

Modifying Commands

Select macro buttons and toolbars to load and edit the parameters. Use context menu or commands box to reorganize the commands as shown below.

Modifying commands and command groups
Modifying commands and command groups

  1. Move selected macro button to the left or move toolbar up
  2. Move selected macro button to the right or move toolbar down
  3. Add new macro button left to the selected macro button or add new toolbar above the selected toolbar
  4. Add new macro button right to the selected macro button or add new toolbar below the selected toolbar
  5. Remove selected macro button or toolbar
  6. Save changes and close dialog
  7. Close dialog without saving changes

Saving Changes

If toolbar configuration changed the following message is displayed and SOLIDWORKS needs to be restarted for settings to take effect (unless toolbar is read-only in multi-user environment).

Custom Toolbar specification changed notification
Custom Toolbar specification changed notification

Accessing Macro Buttons

Toolbars are available in the SOLIDWORKS toolbars list:

SOLIDWORKS toolbars list
SOLIDWORKS toolbars list

and in the SOLIDWORKS menu.

Macro buttons in SOLIDWORKS menu
Macro buttons in SOLIDWORKS menu

Toolbars can be reorganized and placed into the SOLIDWORKS command manager area. Visit Customization page for additional customization options for the toolbars and commands.

Macro buttons in SOLIDWORKS toolbar
Macro buttons in SOLIDWORKS toolbar


Powered by Docify