au-s Posted February 17, 2009 Posted February 17, 2009 Hi I have this lisp: (defun GetList () (setq iNest nil eList nil ) (setq iNest (length (last ePick))) (if (= iNest 1) (setq eList (entget (car ePick))) (setq eList (entget (nth (- iNest 2) (last ePick)))) ) (setq sLayer (cdr (assoc 8 eList)) sObjectType (cdr (assoc 0 eList)) ) (if (= "INSERT" sObjectType) (progn (setq sObjectType "BLOCK" sBlockname (cdr (assoc 2 eList)) ) ) ) ) (defun C:test () (setq old_cmd (getvar "cmdecho") old_err *error* *error* xlist_err ) (setq oldlay (getvar "clayer")) (command "_layer" "s" "0" "") (setvar "cmdecho" 0) (command "_.undo" "_be") (prompt "\nChoose a viewport: " ) (if (= (getvar "tilemode") 0) (command "_mspace") (setq koll 4) (while (> koll 3) (setq ePick (nentsel "\nChoose a layer to be frozen : ")) (if (> (length ePick) 3) (progn (GetList) (command "_vplayer" "f" slayer "" "") ) ) (setq koll (length ePick)) ) (setq *error* old_err) (command "_.undo" "_end") (setvar "clayer" oldlay) (setvar "cmdecho" old_cmd) (command "_pspace") (princ)(alert "It only runs in PSPACE")) ) It gives me an error in vlide: ; error: too many arguments: (IF (= (GETVAR "tilemode") 0) etc etc etc .... What I want is for user to: 1. Pick a viewport 2. Choose a layer to freeze from an XFREF 3. When command is done, exit mspace Thanx Or maybe you have another nicer one Quote
badien Posted February 17, 2009 Posted February 17, 2009 Here is my modified file. Hope it to help you! Cheers! tmp.lsp Quote
Lee Mac Posted February 17, 2009 Posted February 17, 2009 It returns too many arguments I believe because you have missed the use of a progn statement after that IF function, therefore it is trying to evaluate too many terms Quote
au-s Posted February 17, 2009 Author Posted February 17, 2009 It returns too many arguments I believe because you have missed the use of a progn statement after that IF function, therefore it is trying to evaluate too many terms Yes Sir! I noticed ... Thanx LeeMac & badien 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.