Avatech Tricks: Fillet & Chamfer: Multiple Choice -- Part 215 Jun, 2005 By: Jerry Berns Cadalyst
Create your own Fillet and Chamfer toolbar
In the second part of this series, I'll demonstrate how to create a fillet and chamfer toolbar with preset values. Creating a toolbar extends the Multiple option and reduces the repetitive typing of commonly used fillet and chamfer values.
In the previous article, I demonstrated how to change the Fillet and Chamfer buttons to automatically use the Multiple option. This article extends this capability to a fillet and chamfer toolbar with common preset values.
Create the Custom Menu
I recommend creating custom toolbars in a separate file from the AutoCAD menu set. Begin by creating a folder on your hard drive where you'll store the custom menu. We'll use drive C: for this example. Within that folder, create a text file with an MNU extension. Note that you may need to display file extensions (Tools / Folder Options? / View tab) to see a similar view. In figure 1, I created a file named AVATECH_CUSTOM.MNU in the folder C:\Menus.
Figure 1. Create the MNU file in a custom folder.
Now double-click the MNU file to open it in a text editor such as Notepad. Referring to the AutoCAD Customization Guide -- The Menu File -- Overview of Menu Files, input the first two lines as shown below, substituting your company name:
Match the filename used above to the name given in the MENUGROUP statement. Save and close the file.
Load into AutoCAD
Next, load the custom menu into AutoCAD. Start AutoCAD, run the Options command and select the Files tab. Use the Add and Browse buttons to add the folder created above to the Support File Search Path (figure 2).
Figure 2. Add the custom menu folder to the AutoCAD Support File Search path.
Next, use the Menuload command to browse, set the file type to MNU and select the menu from the folder (figure 3).
Figure 3. Load the custom menu.
After selecting the Load button, a warning appears concerning loading MNU files. This is normal. Select OK. Refer to the Customization Guide if you want additional details. Close the dialog box.
Create the Toolbar
Run the Customize command (under the Tools menu) to begin the toolbar creation. Select the Toolbar tab and then select the custom menu from the list followed by the New button. Input the name Fillet for the new toolbar name. An empty toolbar named Fillet should appear, usually above the Customize dialog box.
Select the Commands tab within the dialog box, and then select the Modify category. Scroll the Commands list to find the Fillet command (figure 4).
Figure 4. Locate the Fillet button.
Create the Button
Drag and drop this Fillet button onto the new Fillet toolbar. Select this newly placed button, then select the Button Properties tab in the dialog box. Edit the contents to reflect a common size that is used for fillets. A zero (0) value is often used for drawing clean up. That button's properties are shown in figure 5.
Figure 5. The properties of the new Fillet button.
The macro for the fillet with multiple option and radius 0 should be as follows:
The macro can be broken down as the following:
|^C^C||Cancel any running command.|
|_fillet;||Fillet command. The semicolon acts as the Enter key.|
|u;||mUltiple option, Enter key. Note that letter "U" not "M" is required.|
|r;0;||Radius option, press Enter, value of zero (0), press Enter.|
Edit the button image as desired. Select the Apply button when the edit is complete. Repeat the drag, drop and edit process for all commonly used fillet values. This process could apply to a custom chamfer toolbar as well. However, to cause other commands to repeat from a button selection, use the asterisk (*) character as the first symbol in the macro. Refer to the Customization Guide for further information.
Figure 6 shows the completed Fillet and Chamfer toolbars. The last button on the respective toolbar is the default command with the Multiple option added to the macro, but no preset value is set. The button uses the previous user value.
Figure 6. The completed Fillet and Chamfer custom toolbars.
These custom toolbars certainly make it easier to create multiple fillets or chamfers from common sizes. Some users still prefer to type commands. For that reason, you can add the following code to your ACAD2004DOC.LSP or ACAD2005DOC.LSP file to gain the benefit of the Multiple option:
(defun C:F () (command "FILLET" "u")(princ)) (defun C:CHA () (command "CHAMFER" "u")(princ))
For AutoCAD 2006 Users
AutoCAD 2006 adds an Undo option for the Fillet and Chamfer commands. Due to this enhancement, some adjustments to the macros are required. Replace all occurrences of the single letter "u" with the letter "m".
The AutoCAD 2006 macro for the fillet with multiple option and radius 0 should be as follows:
The AutoCAD 2006 keyboard shortcut would be as follows:
(defun C:F () (command "FILLET" "m")(princ)) (defun C:CHA () (command "CHAMFER" "m")(princ))
Catch the Movie
This tech tip has been posted as an AVI file. Click here to watch the video.
Autodesk Technical Evangelist Lynn Allen guides you through a different AutoCAD feature in every edition of her popular "Circles and Lines" tutorial series. For even more AutoCAD how-to, check out Lynn's quick tips in the Cadalyst Video Gallery. Subscribe to Cadalyst's Tips & Tricks Tuesdays free e-newsletter and we'll notify you every time a new video tip is available. All exclusively from Cadalyst!
My ConnectMyDNA Results 21 May, 2013
When Physical Prototypes Aren’t an Option 21 May, 2013
My Perfect Electric Bicycle is a Motorcycle! 21 May, 2013