Reference Topics > Controlling command button properties
  
Controlling command button properties
You can change the appearance of command buttons in several ways. For example, you may wish just to show text and not the image or, you may wish to show both.
1. Click File, then Customize to display the Customize dialog box.
2. Position the pointer over an icon on any toolbar and right-click the mouse button to display the following:
Reset to Default: Resets the selected icon to its default setting.
Copy Button Image: Copies the image to the clipboard.
Delete: Deletes the button from the toolbar. To retrieve it, click the Commands tab, select the appropriate category from the Categories box and drag the icon into the toolbar.
Button Appearance: Lets you change the appearance of existing command buttons. You can also create new buttons by editing an existing image and saving it under a new name.
Image: Replaces the button text with an image.
Text: Replaces the button image with text.
Image & Text: Sets the button to show both an image and text. If you choose image and text, the text becomes the tooltip.
Start Group: Starts a new toolbar group (puts a vertical separator to the left of the button).
Creating new commands and modifying existing commands
With the pixel editor and the macro recorder, it is easy to create new icons and assign a command sequence to them. You can also select existing commands and modify them. This is all done in the User Defined Command dialog which is displayed when you click New or Modify.
See the following example Recording a Macro for step-by-step instructions on how to do this.
Creating a new menu
To create a new menu item, select Menus in the Groups box and drag the New Menu command in the Commands box to any menubar, toolbar, or context menu. To change the name, right-click the mouse button, select Button Appearance and change the text.
Recording a macro
This example shows you how to record a macro, assign it to a button and place the button in a toolbar. In this example, the macro generates an extruded block having the dimensions 100x50x55.
1. Click File, then Customize to display the Customize dialog box.
2. Make sure the Commands tab is enabled.
3. Click New to display the User Defined Command dialog.
4. Under Command ID:
Type in Extrude 55 in the Name field.
Select Machine in the Group field.
Select CoCreate 3D Access in the Application field.
5. Under Description, type in Extrudes a 55 mm block. This is the prompt text.
6. Under Image, click Browse and select the bitmap image extrude.bmp from ../personality/bitmaps/bmp/commands/3DAccess/Machine.
7. Click Modify and use the pixel editor to modify the image in such a way that it is easily recognized. In this example, the number 55 was added.
8. Click Save to save the modified image.
9. Click Record to start recording the macro. Notice that the User Defined Command dialog is reduced to a Stop Command Recording button. Do the following:
a. Click Create 2D in the main menu
b. Click Rectangle
c. In the user input line, enter 0,0 100,50
d. Click Machine in the main menu
e. If necessary, enter a part name (for example, p1)
f. In the Distance field, enter 55
g. Click OK
h. Click Stop Command Recording to return to the full User Defined Command dialog.
i. Click OK to close this dialog and return to the Commands tab.
10. Scroll down the Categories box and highlight Machine. Your new command (Extrude 55) should now be available at the bottom of the Commands box. Simply drag this command into your favorite toolbar and close the Customize dialog.
To verify if the macro works, click the Extrude 55 button to create an extruded block.
Note the following when defining commands and recording macros:
The Localized (Optional) box provides additional fields for localized naming purposes. They are filled automatically if left blank.
You can specify the name of an existing group or enter a new name to create a new group (for example, My Commands).
The UI Behavior box specifies the position of a menu when it is displayed:
Default places the menu below the main menu (assuming it has not been moved).
Relative places the menu next to the button.
On Request means that the menu options are not shown by default. Use the advanced button to view the menu options.
None means no menu.
When recording a macro, clicking in the viewport is not allowed.
Editing an icon does not affect existing icons currently available in toolbars and menus.