Why doesn't this work in a macro?
Using AutoCAD 2014
Code:^C^C(setq CE (getvar "CMDECHO"))(setvar "CMDECHO" 0)(setq DIST (getdist "Enter distance or <first point>:"))(setq DISTT (/ DIST 2))(command "offset" DISTT)(setvar "CMDECHO" CE)
|
|
|
Why doesn't this work in a macro?
Using AutoCAD 2014
Code:^C^C(setq CE (getvar "CMDECHO"))(setvar "CMDECHO" 0)(setq DIST (getdist "Enter distance or <first point>:"))(setq DISTT (/ DIST 2))(command "offset" DISTT)(setvar "CMDECHO" CE)
Last edited by BlackBox; 2014-09-08 at 10:45 PM. Reason: Please use [CODE] Tags
Because it is a lisp routine... not a macro.
Set your routine to a command. For example:
Save the lisp file in your support file search path.Code:(DEFUN C:o2 () (setq CE (getvar "CMDECHO")) (setvar "CMDECHO" 0) (setq DIST (getdist "Enter distance or <first point>:")) (setq DISTT (/ DIST 2)) (command "offset" DISTT) (setvar "CMDECHO" CE) )
Make sure the lisp routine is loaded.
Then your macro can be:
Code:^C^Co2;
"How we think determines what we do, and what we do determines what we get."
Sincpac C3D ~ Autodesk Exchange Apps
Computer Specs:
Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000
R.K. McSwain | CAD Panacea |
You might also want to look into the PAUSE keyword/function.
[Edit] - Or, given the simplicity of the macro, simply adding an OFFSET Command alias.
Last edited by BlackBox; 2014-09-09 at 02:21 PM.
"How we think determines what we do, and what we do determines what we get."
Sincpac C3D ~ Autodesk Exchange Apps
Computer Specs:
Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000
Didn't know that... learned something new You guys are good for that around here.
"How we think determines what we do, and what we do determines what we get."
Sincpac C3D ~ Autodesk Exchange Apps
Computer Specs:
Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000
You can specify commands to be called under certain keystroke aliases. I.E. I have the command MATCHPROP to QR such that when I type QR it knows to run matchprop. You can access the command alias interface by typing ALIAS at the command line. It's a critical tool for drafting and speed.
HTH
What "Mr. Box" is suggesting (I believe)...
This macro basically does what the "offset" command does**, so why don't you create an alias (shorter version of the command) of offset to do this?
Some people use "Alias Editor" but I go right into the Acad.pgp file to create/edit my command alias'.
**The offset command allows either a typed in distance or you pick a distance (2 points on screen) which seems to be what you're doing in the macro.
Just a thought
BTW, my alias for "offset" is simply the letter "o", you can't get much quicker than:
(command "o" <pick two points> <select line> <pick side you want it to offset> done!)
Last edited by tedg; 2014-09-09 at 04:39 PM. Reason: added example