Вы находитесь на странице: 1из 5

Suggested Technique for Creating Mapkeys and Adding to a Toolbar Keyboard macros, or "mapkeys", may be created to execute a sequence

of frequently used commands. These mapkeys may be mapped to a keyboard key (or keys) which are used either in the current session or saved in your configuration file (usually the config.pro file) for use in future sessions. As of Release 20.0, these macros may be created using the Mapkey functionality in the Utilities menu. Button icons may also be created with mapkeys for easy selection and display in toolbars . Procedure 1. From the Utilities drop down menu select Mapkeys.... This will invoke a Mapkeys dialog box. 2. Select New to invoke the Record Mapkey dialog box and create a new mapkey. 3. Enter the key (or keys) for executing the macro in the Key Sequence input panel. When assigning a mapkey to a function key use the following format: $function key.

For example: The F3 function key would be entered as $F3 4. Enter a name in the Name input panel if an icon for the mapkey is to be displayed in a toolbar. 5. Enter into the Description input panel the help text to be displayed for a mapkey icon placed in a toolbar.

6. Select Record and perform the actions that are to be included in the mapkey. Select Stop when finished defining the mapkey and OK to return to the Mapkey dialog box. 7. Select Changed from the Mapkey dialog box to save newly created mapkeys or ALL to save all mapkeys to a configuration file. Answer the prompt: Enter configuration file name: config.pro [RETURN]

8. Mapkeys will be available for use in the current session only unless saved in a configuration file using Changed or All. 9. Select Close when finished defining mapkeys. 10.To add the mapkey icon to a toolbar, select the Utilities menu and choose Customize Screen.... The Customize Screen dialog box will appear as shown below.

11.Choose Mapkeys from the Categories box. Select the mapkey and drag the mapkey icon into the toolbar. The default icon for the mapkey can be changed by selecting the the icon from the list of mapkeys and holding down the right mouse button. Select Edit Button Image..., and the Button Editor dialog box will appear. Select a color, then click on a pixel to change it to the desired color. The arrows may be used to shift the image within the icon. Choose OK when finished, the OK from the Customize dialog box.

Example 1: Creating a mapkey that turns off the display of datum planes in a model. Select the Utilities drop down menu and pick Mapkeys. Select New and enter "$F3" in the Key Sequence input panel. Enter "Off" in the Name input panel and "This mapkey will turn off the display of datum planes" in the Description input panel. Select Record, then from the Utilities drop down menu select Environment, uncheck Datum Planes, and select OK. Select Stop and OK from the Record Mapkey dialog box. Select Changed and enter a carriage return in the message window to save the mapkey to the default configuration file. Select Close from the Mapkey dialog box. Entering the [F3] key at any time will execute a macro to turn off the environment display of datum planes in a model.

Example 2: Creating a mapkey that creates a new part containing default parameters. Select the Utilities drop down menu and choose Mapkeys. Select New and enter "prt" in the Key Sequence input panel.

Enter "PRT" in the name field and "This mapkey will create a new part with default parameters" in the Description field. Select Pause for keyboard input to allow for a pause when entering the name of a new part and select Record. Select the File drop down menu, select New, and then Pause from the Record Mapkey dialog box. Type "Resume" into the Resume dialog box and select OK. Select OK from the New dialog box. Choose Resume from the Record Mapkey dialog box. Select Set Up, Parameters, Create, select the parameter type, enter the paramter name and value and Done Select Stop and OK from the Record Mapkey dialog box. Select Changed and enter a carriage return in the message window to save the mapkey to the default configuration file. Select Close from the Mapkey dialog box Selecting the [prt] keys at any time will create a new part that contains the predefined default parameter(s). In the previous example, one of the commands in the [prt] mapkey asks for an input that must be entered from the keyboard (e.g. the name of a part). The macro will pause allowing for keyboard input and then continue execution when Resume is selected

Вам также может понравиться