Creating A User Interface Overview
There are four ways a macro can be run from within SmartCAM. These four methods are:
- Command Line Argument
When the SmartCAM application is started the full path and filename for the macro is supplied on the command line. The macro path and filename are preceded by the -m option. Example:
PMILL.EXE -mC:\MACROS\PATHLEN.MCL
This would start Production Milling and run the Path Length macro developed as part of the From the Beginning tutorial. If the path contains spaces, it must be surrounded by double-quotes.
PMILL.EXE -m"C:\Program Files\SmartCAM\MACROS\PathLen.MCL" - Macro - Execute
The Macro Execute dialog is used to run the macro. This is covered in the Fundamentals: Running a Macro topic. - Toolbar
A macro can be associated with an icon on the application toolbar. Pressing the toolbar icon will launch the macro. - Custom Control Panel
The macro can be launched from a custom control panel, which is added to a custom toolbar, your User menu, or integrated into selected other tool sets.
Of these four methods, only the Custom Control Panel option is innately associated with having a user interface. Where a User Interface is defined as a panel or dialog box that can contain input tokens, option buttons, list boxes, and is triggered or cancelled with action buttons.
The following is an example of a Custom Control Panel. It is the User Elements - Polygon panel.
Custom Control Panel
A custom control panel looks and works very similar to a regular built-in application panel. The
panels are created with a utility called the "Visual CTK." The CTK
(Visual CTK)
creates a PCB
file, which is a binary file that contains the panel definitions. The PCB file
is then integrated into the application's USER menu or can be included in the existing Create, Edit, and
Process task sets.
Like standard application control panels, custom control panels can have an icon displayed on the panel. They can contain nearly all of the same input fields as a regular built-in panel; with the exception of the dynamic groups and views lists. It is even possible to store Keep Defaults for a custom panel.
One difference is that custom panels do not support dimming. Dimming is making a token inactive; usually until some condition is met.
A custom panel contains a number of input fields or option fields, each with an associated variable name. It also contains at least a GO button, which is associated with a macro. When Go is triggered, all the variables on the panel are declared in the SmartCAM variable system and the macro associated with the panel is run.
Dialog Boxes
The CTK can also create a PCB file that contains Dialog Boxes. The Dialog Boxes can be called from any SmartCAM macro, even if the macro is not run from a Custom Control Panel.
Like a Custom Control Panel, a Dialog Box can contain SmartCAM input tokens and action buttons. It is associated with a macro, so that when the Accept button is triggered, the macro is run.
For More Information
The Visual CTK online help also includes detailed information on the use of the utility and how to built a custom panel or dialog.
Related Topics