View Full Version : Menu script to LISP
eric_monceaux
23rd Apr 2006, 03:50 pm
I have a menu script that I use, and I was just curious as to whether this can be made into a simple LISP. Here is the script.
^C^Cmline;j;z;s;.25;\\;xplode;l;;la;mortar;
Basically what it does is draw a 1/4" MLine, and explodes it onto the "mortar" layer.
CarlB
23rd Apr 2006, 11:55 pm
I'm not sure how your script changed the exploded line to "mortar" this is how I would change it, with the "change" command. I'm not able to test to see if the "previous" works as I think.
(command "._mline" "_j" "_z" "_s" 0.25 pause pause "._explode" "_l" "" "-change" "_p" "" "_la" "mortar" "")
Another way would be to set layer mortar curent then draw the mline, or change the mline to "mortar" before exploding (like below);
(command "._mline" "_j" "_z" "_s" 0.25 pause pause "-change" "_l" "" "_la" "mortar" ""._explode" "_l" "")
eric_monceaux
24th Apr 2006, 01:51 pm
CarlB,
Do I just cut and paste that code into notepad and save it as a LISP?
good_m
24th Apr 2006, 02:00 pm
That's what I always do...save it with an .lsp extension and then use the appload command in autocad to load it.
Mike
eric_monceaux
24th Apr 2006, 02:13 pm
For some reason, it didnt work. Here is the results from the command line.
Command: ._mline
Current settings: Justification = Zero, Scale = 0.25, Style = STANDARD
Specify start point or [Justification/Scale/STyle]: _j
Enter justification type [Top/Zero/Bottom] <zero>: _z
Current settings: Justification = Zero, Scale = 0.25, Style = STANDARD
Specify start point or [Justification/Scale/STyle]: _s
Enter mline scale <0.25>: 0.250000000000000
Current settings: Justification = Zero, Scale = 0.25, Style = STANDARD
Specify start point or [Justification/Scale/STyle]:
Point or option keyword required.
Specify start point or [Justification/Scale/STyle]:
Specify next point:
2D point or option keyword required.
Specify next point:
Specify next point or [Undo]: ._explode
2D point or option keyword required.
; error: Function cancelled
good_m
24th Apr 2006, 02:18 pm
use this code:
(defun c: mortar ()
(command "._mline" "_j" "_z" "_s" 0.25 pause pause "._explode" "_l" "" "-change" "_p" "" "_la" "mortar" ""))
now to start the command you just type in the word "mortar".
Mike
Powered by vBulletin™ Version 4.1.2 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.