Macros
(Toolbar Button Code)
Macros
are small groups of commands and routines that can be run
in regular AutoCAD as well as ACAD LT. Thes macros (the code
in blue) can be found or typed into the macro area when editing
or creating a toolbar button. This code is here as an example
to show how macros are written. Please see the disclaimer
at the bottom of the page.
Here are a few macros.
Macro
1. Start a line on a newly defined layer.
^C^C_-layer;make;pipe;color;red;;;line;endpoint;
Macro
2a. Insert a block. (2004 -2000 series)
^C^C_-insert;storm.dwg;
Macro
2b. Insert a block. (R14/LT97/98)
^C^C_insert;storm.dwg;
Macro
3a. Insert a block at a set scale. (2004 - 2000 series)
^C^C_-insert;storm.dwg;\24;24;;
Macro
3b. Insert a block at a set scale. (R14/LT97/98)
^C^C_insert;\24;24;;
Macro
4a. Insert a block on a newly defined layer at a set scale.
(2004 - 2000 series)
^C^C_-layer;make;storm.dwg;color;5;;;-insert;;\24;24;;
Macro
4b. Insert a block on a newly defined layer at a set scale.
(R14/LT97/98)
^C^C_-layer;make;storm;color;5;;;insert;storm.dwg;\24;24;;
Macro
5. Load and execute a LISP command. (Full versions only.)
^C^C(load "heal") heal;
Macro
6. Load and execute a LISP command and then plot.
(Full versions only.)
(This works well with the Date Stamp LISP routine.)
^C^C(load "dstamp") dstamp;plot;
Macro
7. Set the fillet radius to "0" prior to filleting
the first lines.
(All versions.)
^C^C_fillet;r;0;
Macro
8. The following is an example of a somewhat complex macro.
It executes the following list of commands.
Builds
a layer
Sets the layer current
Sets the color
Inserts a block
Defines the block scale and rotation
Inserts a second block and places at the last point chosen
This was the insertion point of the previous block
Defines the block scale and rotation
Draws a polyline from the last point chosen
Sets the width of the polyline drawn
Inserts a third block and sets the Object Snap to end
Resets the polyline thickness to "0"
Releases
2004/2002/2000i/2000 2004LT/2002LT/2000iLT/2000LT
^C^C_-layer;make;TAGS;color;red;;;_-insert;c:/blocks/tag.dwg;\
96;96;;\_insert;c:/blocks/scale96.dwg;$m=$(getvar,lastpoint);
96;96;;_pline;$m=$(getvar,lastpoint);w;1;;\;_insert;c:/block/
tag2.dwg;end;\96;96;;\\plinewid;0;
Releases
R14/LT97/98
^C^C_-layer;make;TAGS;color;red;;;_insert;c:/blocks/tag.dwg;\
96;96;;\_insert;c:/blocks/scale96.dwg;$m=$(getvar,lastpoint);
96;96;;_pline;
$m=$(getvar,lastpoint);w;1;;\;_insert;c:/block/
tag2.dwg;end;\96;96;;\\plinewid;0;
CADTECH
SEMINARS,LLC DISCLAIMS ANY AND ALL LIABILITY FOR ANY DAMAGES
ARISING OUT OF THE USE OR OPERATION, OR INABILITY TO USE ANY
SOFTWARE, CODE OR FILES AVAILABLE OR LINKED HERE. FURTHERMORE,
BY DOWNLOADING ANY FILE OR CODE YOU AGREE TO HOLD CADTECH
SEMINARS, LLC HARMLESS FROM SUCH CLAIMS. CADTECH SEMINARS,LLC
MAKES NO WARRANTY, EITHER EXPRESSED OR IMPLIED, AS TO THE
FITNESS OF THESE FILES FOR ANY PARTICULAR PURPOSE. ALL MATERIALS
ARE TO BE CONSIDERED 'AS-IS', AND USE OF ANY FILES SHOULD
BE CONSIDERED AS AT YOUR OWN RISK!
New
LISP and Macros will be added to this page periodically.
If
you have a neat tip, trick, LISP routine, or macro and would
like us to consider adding it to our site with your name,
please e-mail us @
support@CADtechSeminars.com
|