TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: mailmaverick on April 15, 2019, 05:05:24 AM

Title: Delete Command with name stored in Variable
Post by: mailmaverick on April 15, 2019, 05:05:24 AM
Hi,

I have a command name as string (say "COPY") stored in a variable called 'commandname'.
I want to delete the command for usage in AutoCAD.
My code : (set (read (strcat "C:" commandname)) nil) is not working
Please Help.
Title: Re: Delete Command with name stored in Variable
Post by: kpblc on April 15, 2019, 06:19:49 AM
Maybe "_.undefine" command will help?
Title: Re: Delete Command with name stored in Variable
Post by: VovKa on April 15, 2019, 06:22:28 AM
(vl-acad-undefun  (read (strcat "C:" commandname)))
Title: Re: Delete Command with name stored in Variable
Post by: Lee Mac on April 15, 2019, 08:17:22 AM
Assuming this is for licensing purposes, it is probably easier to redefine the function as something else (which could then display an informative message to the user).
Title: Re: Delete Command with name stored in Variable
Post by: mailmaverick on April 16, 2019, 10:49:38 AM
Excellent Vovka !!!!