Jump to content

Recommended Posts

Posted

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

Posted
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

Posted

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

Posted

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

Posted
(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

  • 2 weeks later...
Posted

Have you tried using vl-acad-undefun?

 

This works for me:

(foreach x '(c:routine1 c:routine2 c:routineN)
 (vl-acad-undefun x)
)

Posted

Thanks Lee! : )

Welcome to CADTutor Steve - nice to see you here :)
Posted

Cheers mate works great didnt think to lookin in VL for undefun

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...