-
1
- #1
takedownca
Mechanical
- Mar 2, 2007
- 145
Here's a tip for all those annoyed at SW's inability to add or delete separator lines in toolbars. It's a bit involved, but not beyond anyone that likes to get into the nuts and bolts of things. To facilitate proper execution, I've added as much detail as possible to each step. I hope someone finds this helpful.
[ol]
[li]Record the name of the toolbar you want to modify.
[/li]
[li]Record the layout of the toolbar (e.g. 3 buttons, separator, 2 buttons, separator, 4 buttons). An example of shorthand for this would be 3/2/4 or xxx/xx/xxxx for those more visually inclined.
[/li]
[li]Write down the relative location of each separator you want to add or delete (e.g. insert after 2nd icon, delete after 3rd icon). When counting icon positions, include existing separators. Again, an example of shorthand would be xx|x<>xx/xxxx or 2i1d2/4 (2 buttons, insert separator, 1 button, delete separator, 2 more buttons, a separator, and 4 more buttons).
[/li]
[li]Close SW.
[/li]
[li]Start the Copy Settings Wizard.
[/li]
[li]Choose to backup only toolbar settings. This part isn't necessary, but since you'll be reimporting these settings later it's safer to only deal with the settings that will be modified.
[/li]
[li]Create a SLDREG settings file.
[/li]
[li]Open the settings file in a text editor (Notepad++ works well).
[/li]
[li]It's a lot of text (~5000 lines), but you'll be leaving most of the text alone. Find a line that reads [tt]HKEY_CURRENT_USER\...\User Interface\Toolbars[/tt].
[/li]
[li]Look for the names of the toolbars that you wrote down in Step 1. The names are pretty straight forward, and you won't have to look too hard since this section isn't too long (<100 lines).
[/li]
[li]Here's the fun part. Each line records the buttons for that particular toolbar using a quad hexadecimal scheme. Each button corresponds to 4 hex numbers of the form [tt]##,##,00,00,[/tt] (buttons seem to always end in [tt]00,00,[/tt]). A separator is indicated by [tt]ff,ff,ff,ff,[/tt]. All you have to do is move the instances of [tt]ff,ff,ff,ff,[/tt] to where you wanted the separators (see Step 2). Here's an example.
Below is the line for the Dimensions/Relations Toolbar. I know. "uiSkConstraintsToolBar_c" doesn't have "dimension" or "relation" in the name, but you can figure it out. A good (but not fool proof) way to verify you're looking at the right toolbar line is to count the number and placement of buttons ([tt]##,##,00,00,[/tt]) and separators ([tt]ff,ff,ff,ff,[/tt]). An easy way to do this is to use the Find function of your text editor and search for [tt]00,00,[/tt], which signals the end of a button code. Every time you push F3 (Find Next) you're skipping to the next button. The layout should match that of the toolbars you want to edit. In this case it has 10 buttons and no separators. The downside to this counting method is that you might identify the wrong toolbar if it has the same button/separator layout as your intended target toolbar.
This is what the line should look like if I want to separate the buttons into groups of 4, 4, and 2. You'll see I've inserted [tt]ff,ff,ff,ff,[/tt] in 2 different places.
[/li]
[li]Double-click the edited settings file to import it to the registry. Make sure to create a backup of your existing settings.
[/li]
[li]Restart SolidWorks and bask in the joy of your new separators. Of course this is assuming you haven't screwed something up. If something did go wrong, then import the backup settings and start over.
[/li]
[/ol]
[ol]
[li]Record the name of the toolbar you want to modify.
[/li]
[li]Record the layout of the toolbar (e.g. 3 buttons, separator, 2 buttons, separator, 4 buttons). An example of shorthand for this would be 3/2/4 or xxx/xx/xxxx for those more visually inclined.
[/li]
[li]Write down the relative location of each separator you want to add or delete (e.g. insert after 2nd icon, delete after 3rd icon). When counting icon positions, include existing separators. Again, an example of shorthand would be xx|x<>xx/xxxx or 2i1d2/4 (2 buttons, insert separator, 1 button, delete separator, 2 more buttons, a separator, and 4 more buttons).
[/li]
[li]Close SW.
[/li]
[li]Start the Copy Settings Wizard.
[/li]
[li]Choose to backup only toolbar settings. This part isn't necessary, but since you'll be reimporting these settings later it's safer to only deal with the settings that will be modified.
[/li]
[li]Create a SLDREG settings file.
[/li]
[li]Open the settings file in a text editor (Notepad++ works well).
[/li]
[li]It's a lot of text (~5000 lines), but you'll be leaving most of the text alone. Find a line that reads [tt]HKEY_CURRENT_USER\...\User Interface\Toolbars[/tt].
[/li]
[li]Look for the names of the toolbars that you wrote down in Step 1. The names are pretty straight forward, and you won't have to look too hard since this section isn't too long (<100 lines).
[/li]
[li]Here's the fun part. Each line records the buttons for that particular toolbar using a quad hexadecimal scheme. Each button corresponds to 4 hex numbers of the form [tt]##,##,00,00,[/tt] (buttons seem to always end in [tt]00,00,[/tt]). A separator is indicated by [tt]ff,ff,ff,ff,[/tt]. All you have to do is move the instances of [tt]ff,ff,ff,ff,[/tt] to where you wanted the separators (see Step 2). Here's an example.
Below is the line for the Dimensions/Relations Toolbar. I know. "uiSkConstraintsToolBar_c" doesn't have "dimension" or "relation" in the name, but you can figure it out. A good (but not fool proof) way to verify you're looking at the right toolbar line is to count the number and placement of buttons ([tt]##,##,00,00,[/tt]) and separators ([tt]ff,ff,ff,ff,[/tt]). An easy way to do this is to use the Find function of your text editor and search for [tt]00,00,[/tt], which signals the end of a button code. Every time you push F3 (Find Next) you're skipping to the next button. The layout should match that of the toolbars you want to edit. In this case it has 10 buttons and no separators. The downside to this counting method is that you might identify the wrong toolbar if it has the same button/separator layout as your intended target toolbar.
"uiSkConstraintsToolBar_c"=hex: 5e,80,00,00,66,85,00,00,65,85,00,00,1f,93,00,00,a9,80,00,00,ab,80,00,00,dc,80,00,00,64,85,00,00,b1,80,00,00,9f,80,00,00,33,9f,00,00,

This is what the line should look like if I want to separate the buttons into groups of 4, 4, and 2. You'll see I've inserted [tt]ff,ff,ff,ff,[/tt] in 2 different places.
"uiSkConstraintsToolBar_c"=hex: 5e,80,00,00,66,85,00,00,65,85,00,00,1f,93,00,00,ff,ff,ff,ff,a9,80,00,00,ab,80,00,00,dc,80,00,00,64,85,00,00,ff,ff,ff,ff,b1,80,00,00,9f,80,00,00,33,9f,00,00,

[/li]
[li]Double-click the edited settings file to import it to the registry. Make sure to create a backup of your existing settings.
[/li]
[li]Restart SolidWorks and bask in the joy of your new separators. Of course this is assuming you haven't screwed something up. If something did go wrong, then import the backup settings and start over.
[/li]
[/ol]