in
    

Ad Space 1


Ad Space Available

 

Ad Space 2


Ad Space Available!

 

This Blog

Syndication

Tags

No tags have been created or used yet.

Archives

Tips & Tricks

February 2008 - Posts

  • AutoCAD Combination Commands

    Creating combination commands using Macros allows you to develop AutoCAD commands that speed up drawing ability without having to edit the Lisp routines.  All though you have more control over commands by editing Lisp routines, using Macro elements is a good starting point for anyone looking to increase efficiency, but also get their feet wet in some programming.

    The easiest way to understand Macro Strings is to think of them as a language, where each character or sets of characters has a meaning, and controls how the command acts through its entry process.

    Adding commands is accomplished through CUI interface with AutoCAD 2007 and above.  You may want to have a basic understanding of the CUI interface before getting into this section.

    Getting Started:

    • Open the CUI Dialog Box; make sure you are working in the main AutoCAD CUI file (acad.cui).  The AutoCAD commands are stored under the command list section.
    • From there, select “New”, this is going to open a new command with the name “Command1”. On the right side of the dialog box, there is an information selection that displays the properties of the new command.

    The Copy Rotate Command:
    This command will allow you to copy and rotate a Profile, Solid, or Surface; all in one command.

    • Under general (for name enter something along the lines of Copy Rotate) under that description is a help text that will pop up when you highlight the command.
    • The next category is macro. Here is where the macro string is written that controls how the command operates. Within that field insert: ^c^c_rotate;_copy;_base;

    Explanation:

    • The ^c is the cancel command. So it does a double cancel command in the beginning to ensure that no other commands are active (this is optional).
    • "_rotate" activates the rotate command.
    • ";" is the character that stimulates the enter key which activates the next command in the string.
    • "_copy" activates the copy command within the rotate command. It is now a selection, during the command you will select copy.
    • ";" another stimulation of enter to move on to the next command
    • "_base" activates the base command. Which is the base point selection to copy and rotate is made.
    • ; this is the final enter stimulation to end the active command after the copy rotate is made.

    The Copy Scale Command:
    This command allows you to scale a Profile, Solid, or Surface while having the option to copy coincidently.  The macro for this command will be: ^c^c_scale;_copy;_base;

    Try both of these combination commands, they should increase drawing efficiency. You can combine most of AutoCAD’s commands in macro string to develop useful customized tools.

    After these commands have been developed they can be applied to any CUI Menus, Toolbars, Toolpalettes, or Grips. They are run as everyday command operations. They can also have hot keys assigned to them for quick keyboard entry.

    Text Commands
    If you are looking to take it one step further here is a more complex Macro string that creates a command that is always based on the aehalf.shx font and a specific text layer. The command will tell the text to always stay at a certain height and rotation direction when entering it.  For this example we will use the font style aehalf.shx.

    The Macro string will read like this:   ^C^C-style;aehalf;aehalf.shx;0;1;0;;;;-layer;m;fixedtext;;dtext;\.1875;0;layer0;
    Here is the same macro string with the definitions inserted for the meaning of what each macro character does:   

    ^Cancel command^Cancel command;-style command;name of text;font file;font height;font width;font angle;;;;-layer command;m;the new layer;;dtext command;\height of text;rotation;restores the layer that was current.

     

    Author: Brannon Pumphrey, Microvellum Technical Support
     

Powered by Community Server (Commercial Edition), by Telligent Systems