nicolas Posted July 29, 2010 Posted July 29, 2010 Hi, I have some difficulty with the following lisp that I just created: (defun c:xv () (command "-layer" "set" "0" "") (command "xline" "ver" pause "") (command "-layer" "previous") (princ) ) The aim of that lisp is to create vertical xline in layer 0 and then to turn back to the original layer but the last command ("-layer") is entered in the xline command and the "" seemed not to end the command. Could anybody help me on this? Thanks, Regards Nicolas. Quote
lpseifert Posted July 29, 2010 Posted July 29, 2010 There is no "previous" option in the -Layer command you might want to look into using something similar to this (setq oldlay (getvar "clayer")) (setvar "clayer" "0") [i]CODE[/i] (setvar "clayer" oldlay) If 2006 has Toolpalettes you might want to try dragging an xline onto a toolpalette, you can set the layer under the tool's properties Quote
nicolas Posted July 29, 2010 Author Posted July 29, 2010 Hi, Thank you very much. I have implemented your code in the little xv command and it is working great. However, there is still a little program inasmuch as I can only draw a vertical xline upon calling xv The program is as follows: (defun c:xv () (setq oldlay (getvar "clayer")) (setvar "clayer" "0") (command "xline" "ver" pause "") (setvar "clayer" oldlay) (princ) ) Could there be any other keywords that may have the ideal response rather than using "pause"? Regards, Nicolas Quote
lpseifert Posted July 29, 2010 Posted July 29, 2010 You ought to post your code with code tags... and get rid of them friggin smilies http://www.cadtutor.net/forum/showthread.php?9184-Code-posting-guidelines get rid of the "ver" or (defun c:test (/ oldlay) (setq oldlay (getvar "clayer")) (setvar "clayer" "0") (command "xline" ) (while (= 1 (getvar "cmdactive")) (command pause)) (setvar "clayer" oldlay) (princ) ) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.