Integration with SmartCAM User Interface
There are several different ways to integrate your custom macros or panels in to SmartCAM. The macro or panel can be assigned to a hotkey, such as F6 or Shift+F12; it can be associated with an icon on the toolbar; it can be added to a special User main menu selection; or it can be integrated into existing Create, Edit, or Process menus.
Hotkeys
The application .INI file is used to associate a macro or panel with a hotkey. To associate a macro, panel, or SWEL command to a hotkey, complete the following.
- Open your application INI file in a text editor
Load your application's INI into a text editor, such as Notepad. Make sure your SmartCAM application is closed and not running.
If unsure where the application INI files reside, temporarily open your SmartCAM application. Select Help - About, the
Configuration Location
path, at the bottom of the about box, is the location of the INI files. You can click on the Open Folders button to launch a Windows Explorer, that opens in the folder with the INI files.Close your SmartCAM application.
- Locate the [Hotkeys] INI section
The
[Hotkeys]
section shows the various hotkey combinations supported by SmartCAM. Locate the key or key combination you want to assign to your macro or panel. - Make the assignment
If the key or key combination you want to use is commented out, remove the leading semicolon. This will uncomment the line. Now, tell SmartCAM what to assign to this hotkey.
Macro
To assign a macro, use the following syntax:macro "path\filename.ext"
For example to assign
C:\MACROS\ViewCustom.mcl
toSHIFT+F10
the INI entry would look like:SHIFT+F10=macro "C:\MACROS\ViewCustom.mcl"
Panel
To assign a custom panel, use the following syntax:
panel "Panel Name"
For example to assign the
Path Length
custom control panel toSHIFT+F10
the INI entry would look like:SHIFT+F10=panel "Path Length"
SWEL Command
SWEL
(SmartCAM Workspace Environment Language) commands give you access to most SmartCAM functionality; such as Views, Groups, dialogs, and panels. You can find a complete list of SWEL commands and symbol names in theswel_doc.htm
file located in the SmartCAM SHARED directory.For example, the Top view orientation is assigned to the F9 hotkey with:
F9=do "ViewTop"
- Save the INI file
Save the application INI file. Now launch your SmartCAM application and use the Hotkey to verify things are working.
Note: A Custom PCB Panel cannot be assigned to a Hotkey unless it is also associated with a SmartCAM main menu entry. Assigning PCB panels to menus is discussed later.
It is not recommended to replace SmartCAM hotkeys with custom hotkeys.
Iconbar.Def
The ASCII text file, ICONBAR.DEF
, is used to configure the panels, buttons, and icons that
can be added to your toolbar. This file is a SmartCAM maintained file, that includes the button definitions
for the functionality that ships with SmartCAM.
Do not make changes to this file. This file is overwritten during updates and new product installations.
However, the button definition code and format shown in the ICONBAR.DEF can be manually added to your personal custom toolbar button configuration files. This allows you to add your custom panels and macros to your toolbars. For most all purposes, this is never required. You can use the Edit Toolbar functionality to add built-in or custom macro icons to your toolbar.
The file is located in the SmartCAM SHARED\ICON directory. By default this path would be in your versioned files folder:
SmartCAM\SmartCAMv#\Shared\Icon\
The format for an entry in this file is:
BUTTON "Display Name"
EVENT <command> <path or name>
ICON "<icon name>"
HELPLINE "Optional single line help text"
ICNTXTONE "Toolbar button text line one"
ICNTXTTWO "Toolbar button text line two"
The first line establishes this is a BUTTON definition. The "Display Name"
is the name associated with this functionality. This is the name displayed in the Predefined
Buttons list of the Edit Toolbar
window.
Note: There is also a BTNBIN button type. This is a special type of toggle button. You can include toolbar icons based on the BTNBIN events, but you can not create your own. The BTNBIN buttons are buttons that stay active until unselected or overridden; such as many of the buttons on the Group toolbar.
The EVENT line establishes what will happen when this BUTTON
is triggered. The syntax
is the same as the syntax used to assign a macro or panel to a hotkey.
The ICON entry sets which icon is displayed when the macro or panel is associated with the
icon-based toolbar or when a custom PCB panel is displayed. The icon name is the filename for
the icon file, without the .ico
extension.
SmartCAM will check two locations for your icon file. First, it will look in the SHARED\ICON
folder.
This is the same folder that contains the ICONBAR.DEF
file. If not found there, it will check the folder
where the associated macro resides. If found in neither location, a blank button will be created. It is recommended
that you place your custom icon files in the same folder as their related macro file.
The HELPLINE is optional. When you are creating an entry for a custom PCB panel, this line is not needed, as the status bar help is stored with the panel. When working with a macro definition, adding a single-line help message is a good idea. The text entered here is displayed in the SmartCAM status bar or in a tool tip, depending upon how the SmartCAM application is configured.
The ICNTXTONE and ICNTXTTWO are used to enter two short lines of text. This text is displayed on the toolbar, when you configure your toolbar to display button text.
As an example, the following is the entry for the Path Length custom PCB panel.
BUTTON "Path Length"
EVENT panel "Path Length"
ICON "PathLen"
HELPLINE "Find length of profile"
ICNTXTONE "Path"
ICNTXTTWO "Length"
This assumes an existing icon, with the filename PathLen.ico
, is located in the same folder
as the macro called by the Path Length dialog.
Icon
SmartCAM uses the original Windows icon format (not XP or Vista), saved in a ICO format with an .ICO extension. The applications support up to 256 color icons; 15-, 16-, 24-, 32-bit icon formats are not supported.
SmartCAM's toolbar can be displayed in three sizes: Small, Medium, and Large. So three icons are needed for the various sizes; if a needed size is missing SmartCAM will attempt to rescale the existing icon image however the results of the resize are not optimal. The three sizes for icons needed are: 19x19, 24x24, and 32x32 pixels.
All three icon sizes are stored in a single ICO file.
Important Information
Since the ICONBAR.DEF is a free-format ASCII text file the SmartCAM installation routine cannot update the file. Instead it overwrites it on each new installation or upgrade. This means any changes made to the file will be lost after a re-installation.
However, if you make the same changes in your custom toolbar button configuration file, you will not have to worry about the file being overwritten.
You do not need to edit the toolbar button files directly. Instead of manually adding the button configurations, right-click on the toolbar. Then select Edit Toolbar from the pop-up menu. From the Edit Toolbar window, you can add, remove, and reorder the buttons on the selected toolbar.
Toolbar
The SmartCAM toolbar uses an ASCII text file to select what icons are displayed and in what order. The
file is saved with a .BGP19
extension and, by default, is kept in the same directory as the
ICONBAR.DEF
file described above. When reviewing documentation the terms "Toolbar"
and "Icon Bar" are the same thing; one is older terminology being phased out.
SmartCAM ships with a number of preconfigured toolbar button files. You can modify the default shipping .BGP19 files, but like the ICONBAR.DEF file, they will be overwritten during new installations and updates. So, you will need to add your custom buttons back into the file after installing a new version of the application.
SmartCAM's toolbar are controlled by two files. There is a Button Group file
(*.BGP19
). The Button Group file contains a list of the buttons to display on a single
toolbar. When the toolbar is displayed, it will display the buttons configured in this file, in the order
they appear in the file.
Then there is a Toolbar Set or Toolbar Configuration file. This file contains a list of all imported toolbars (imported .BGP19 button group files), whether the toolbar is displayed or not, the toolbar's location and size, the size of the buttons, whether buttons are aligned to the left, right or center (top, bottom, or middle) of strip, and whether button text is displayed and where the text is displayed. In effect, it contains the layout of the toolbars.
The Toolbar Configuration files are named with a .BFG19
extension.
Since the ICONBAR.DEF, *.BFG19, and *.BGP19 files, that ship with SmartCAM, can be overwritten by subsequent updates, it is highly recommended that if you want to make changes to these files that you create your own files and modify them. As long as your files are not named the same as the SmartCAM files and in the same locations, they will not be affected by later installations.
SmartCAM installations create a common area; a folder tree where you can create your versions of these files and keep them readily available and safe from updates. This path is:
\ProgramData\SmartCAM\Common\
It is recommended that you create an ICON\ subfolder, under ..\Common\ to use when creating your own toolbar configuration and button group files.
Creating Button Group Files
If you want to modify a shipped Button Group file, it is recommended that you make a copy of the file and make changes to it instead. To do that complete the following:
- Start your SmartCAM application
- Right-click on the toolbar you want to work on and select Copy Toolbar.... Enter the location (recommend the common\icon folder) and filename to use. Click on the Save button.
- The copy of the toolbar will be saved and will be loaded.
- The original toolbar and the copy are loaded, you will want to remove the original file. So, right-click on the original file and select Remove Toolbar.
Now, any changes made to the toolbar will be made to your copy.
Creating Toolbar Set Files
Like toolbars themselves, you can make and use a copy of the Toolbar Set file. Doing so it recommended to protect it from future updates.
- Start your SmartCAM application
- Either use the menu item Utility - Toolbar Sets - Copy... or right-click on the main menu bar and select Copy Toolbar Set... from the pop-up menu.
- Enter the name and location for the copy of the file. We recommend saving in the Common\Icon folder mentioned above.
- Click the Save button. The Set file will be saved and your copy will become the new active configuration file. Now, any changes you make will be in your files - not the shipping files.
Macros and PCB Panels
Your custom macros can be added directly to your custom toolbar; using the functionality on the Edit Toolbar dialog.
Your custom CTK panels must be packaged as a toolbar buttons before they can be used. See the topic about the
ICONBAR.DEF
for information about how to create a BUTTON. This Button
definition would be added directly to your toolbar button configuration file, in the order where you would
like the button to be presented.
Configure the Toolbar
The size and location of the toolbar is controlled by the Configure Toolbar
dialog box.
- Right-click on the toolbar that you wish to reposition. Select Toolbar - Configure from the pop-up menu. This opens the Configure Toolbar dialog box.
- The Btn Grp File and Bar Cfg File labels are there to remind you which toolbar you are modifying.
- The Visible check box controls whether or not the toolbar is displayed.
- The Position: controls where the toolbar is place. It can either be along one of the walls of the SmartCAM application window or in a floating dialog box.
- The Icon Size: selects which icon size to use: Small (19x19), Medium (24x24), or Large (32x32). To change the size of all toolbars (one size adjustment applies to all displayed icon toolbars), save your changes and close the Configure Toolbar dialog box. Then open Utility - Options, display the Presentation Options category, and adjust the Toolbar Icon Size property.
Displaying a new Toolbar File
You can display multiple toolbars in SmartCAM. Open display a new shipped toolbar or a custom toolbar that you have created and are maintaining do the following:
- Right-click on an existing toolbar and choose Add Toolbar... from the pop-up menu. Or use Utility - Toolbars - Add. This displays an Open dialog, with the default path being the location where the SmartCAM shipped toolbar configuration files reside.
- Browse to and select the toolbar button configuration file you want to use. Current toolbar
button configuration files have a
.BGP19
extension - which stands for "button group."You can also import older SmartCAM
.BAR
configuration files. When a .BAR file is opened, a new file with the new .BGP19 extension is created. This new file is created in the folder where the original .BAR file resides. It is the newer .BGP19 file that is actually displayed by SmartCAM.
Adding to the Toolbar
Built-in SmartCAM functionality or custom macros and panels can be added to the toolbar.
- Right-click on the toolbar you want to modify, select Edit Toolbar from the pop-up menu.
- The
Predefined Buttons
list contains a sorted list of all the icons defined in theICONBAR.DEF
file. Select the icon to add. - In the
Active Buttons
list move the highlight bar to the location where you want to add the new icon. Then use the arrow button (<) to move the icon to your toolbar. - You can use the
Move Up/Down
buttons to reposition the icon as needed. - Accept to add the icon to the bar.
Modifying Toolbar Icons
To change an existing toolbar button, right-click on toolbar and from the pop-up menu select Edit Toolbar. From here you can add new buttons, remove buttons, or change the order of the existing buttons.
To remove a button, highlight the button in the Active Buttons
list, then use the
arrow button (>) to remove the button from the active toolbar and return it to the
Predefined Buttons
list.
Saving Changes
From the Edit Toolbar
window, use Accept to save your changes or
Cancel to leave the toolbar unchanged.
SmartCAM Main Menu
Custom panels can be integrated directly into the SmartCAM main menu. Once integrated, a custom panel can be used just as if it is built-in functionality.
User Menu
The User
menu is a special main menu entry. It is not used by SmartCAMcnc, it exists solely
for customers to use as a location to integrate their custom panels.
The User menu is not displayed until there is one or more custom PCB panel files associated with it. After which time, the menu heading will appear on the SmartCAM main menu.
When adding a name for the User menu, the first capital letter in the menu name is assigned as the Alt-key hotkey. However, if a menu to the left of the User Menu, on the menu bar, already uses that letter no shortcut will be assigned to the User menu. Additionally, if you use the same letter as a menu to the right, the menu to the right will lose its alt-key.
When assigning names to menu items, an ampersand (&) is used to prefix the letter that should be used for the menu Alt-key selection. This key is underlined in the menu, when the menu is displayed. The system will not prevent the same key from being used more than once, so be sure to use unique letters for each taskset.
For example, the taskset menu name: My &Tools
will use the T
as the alt-key.
Adding Custom PCB to User Menu
- Run your SmartCAM application. Open Utility - Options - User Menu Options category.
- Give your
User Menu
a name. This is the name displayed on the Main Menu. If you do not provide a name, User will be the default.Modify the User Menu Name property and enter your Menu name.
- Now you need to add the name for your custom PCB automation. Select the Menu Item # Name property
and enter the name you want associated to this customization.
The
#
in the Menu Item # Name is a numeric value between 1 and 10. There are 10 possible menu items on the User menu. This number is the slot being used.It is important that you do not leave gaps in the sequence. Meaning, do not add a PCB to slot 1 and then to slot 3. You must use slot 2 first. This also applies when you remove items from the menu - if you create a gap in the numbering sequence, move the later items up one to fill in the gap.
- Finally, modify the Menu Item # PCB entry and provide the path and filename to your custom PCB.
Like the Menu Item # Name above, the
#
is the slot number. Make sure you do not create gaps in the sequence.
If a PCB file is missing or does not load, the menu items is dimmed and the warning "Could not file or load pcbfile. Toolbox toolboxname is not available" is displayed.
Create / Edit / Process Menus
Custom PCB panels can be integrated into selected existing SmartCAM main menu categories; these are the Create, Edit, and Process menus.
Adding custom panels to these existing SmartCAM menu items is very similar to the process required
to create and update the User
menu. Custom automations, added to these menus, are added to the end
of the menu.
When assigning names to menu items, an ampersand (&) is used to prefix the letter that should be used for the menu Alt-key selection. This key is underlined in the menu, when the menu is displayed. The system will not prevent the same key from being used more than once, so be sure to use unique letters for each taskset.
For example, the taskset menu name: My &Tools
will use the T
as the alt-key.
Adding Custom PCB to an Existing Menu
- Run your SmartCAM application. Open Utility - Options, then pick the Category for the menu that you want to extend. Choose between Edit Menu Options, Create Menu Options, and Process Menu Options.
- Now you need to add the name for your custom PCB automation. Select the Menu Item # Name property
and enter the name you want associated to this customization.
The
#
in the Menu Item # Name is a numeric value between 1 and 10. There are 10 possible menu items on the User menu. This number is the slot being used.It is important that you do not leave gaps in the sequence. Meaning, do not add a PCB to slot 1 and then to slot 3. You must use slot 2 first. This also applies when you remove items from the menu - if you create a gap in the numbering sequence, move the later items up one to fill in the gap.
- Finally, modify the Menu Item # PCB entry and provide the path and filename to your custom PCB.
Like the Menu Item # Name above, the
#
is the slot number. Make sure you do not create gaps in the sequence.
If a PCB file is missing or does not load, the menu items is dimmed and the warning "Could not file or load pcbfile. Toolbox toolboxname is not available" is displayed.
Related Topics