flowerrobot Posted November 26, 2009 Share Posted November 26, 2009 hey guys Im having a bit of truble with those two commands. Simply im finding that if i load it into one drawing1, then load in into drawing2, drawing 1 will lose its command and return ; error: Visual LISP command document mismatch: hi The reason im using it is because when it come to re-defineing commands i thought this would be easyer Here is an example where its inbeded in a Foreach function of each function and where NewKeyList is a list of what the are to be defined as (vlax-remove-cmd (cadr nm)) (if NewKeyList (progn (setenv (car nm) (nth Int_Count NewKeyList)) (setq Int_Count (1+ Int_Count)))) (eval (read (strcat "(vlax-add-cmd \""(getenv (car nm)) "\" '" (caddr nm)")"))) thanks for any input flower Quote Link to comment Share on other sites More sharing options...
wizman Posted November 27, 2009 Share Posted November 27, 2009 hey guys Im having a bit of truble with those two commands. Simply im finding that if i load it into one drawing1, then load in into drawing2, drawing 1 will lose its command and return The reason im using it is because when it come to re-defineing commands i thought this would be easyer Here is an example where its inbeded in a Foreach function of each function and where NewKeyList is a list of what the are to be defined as (vlax-remove-cmd (cadr nm)) (if NewKeyList (progn (setenv (car nm) (nth Int_Count NewKeyList)) (setq Int_Count (1+ Int_Count)))) (eval (read (strcat "(vlax-add-cmd \""(getenv (car nm)) "\" '" (caddr nm)")"))) thanks for any input flower Could you not use for example: (if (not c:fillet) (command "._UNDEFINE" "_FILLET")) then put same command name for your lisp routine. (defun c:fillet () . . ....etc Quote Link to comment Share on other sites More sharing options...
flowerrobot Posted November 27, 2009 Author Share Posted November 27, 2009 Sorry when i said redefining commands i am refering to routines thus (defun c:hi () (princ "hi") (princ)) (command "._UNDEFINE" "hi")) returns Unknown command name. SystemProtection-V.1.Lsp Quote Link to comment Share on other sites More sharing options...
wizman Posted November 27, 2009 Share Posted November 27, 2009 seems like a namespace issue if you're going that way. You might like to try (Setq c:hi nil) or do a vl-load-all call Quote Link to comment Share on other sites More sharing options...
flowerrobot Posted November 27, 2009 Author Share Posted November 27, 2009 (Setq c:hi nil) when i press hi returns ; error: no function definition: C:HI Could you explan this vl-load-all call since every thing is in a .vlx Aswell i would like it to transfer threw open doc's if possible Cheers Flower Quote Link to comment Share on other sites More sharing options...
Steve Doman Posted December 5, 2009 Share Posted December 5, 2009 Have you tried using vl-acad-undefun? This works for me: (foreach x '(c:routine1 c:routine2 c:routineN) (vl-acad-undefun x) ) Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted December 5, 2009 Share Posted December 5, 2009 Welcome to CADTutor Steve - nice to see you here Quote Link to comment Share on other sites More sharing options...
Steve Doman Posted December 5, 2009 Share Posted December 5, 2009 Thanks Lee! : ) Welcome to CADTutor Steve - nice to see you here Quote Link to comment Share on other sites More sharing options...
flowerrobot Posted December 7, 2009 Author Share Posted December 7, 2009 Cheers mate works great didnt think to lookin in VL for undefun Quote Link to comment Share on other sites More sharing options...
Steve Doman Posted December 7, 2009 Share Posted December 7, 2009 Glad to help! Quote Link to comment Share on other sites More sharing options...
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.