Author Topic: Delete Command with name stored in Variable  (Read 1653 times)

0 Members and 1 Guest are viewing this topic.

mailmaverick

  • Bull Frog
  • Posts: 493
Delete Command with name stored in Variable
« 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.

kpblc

  • Bull Frog
  • Posts: 396
Re: Delete Command with name stored in Variable
« Reply #1 on: April 15, 2019, 06:19:49 AM »
Maybe "_.undefine" command will help?
Sorry for my English.

VovKa

  • Water Moccasin
  • Posts: 1628
  • Ukraine
Re: Delete Command with name stored in Variable
« Reply #2 on: April 15, 2019, 06:22:28 AM »
(vl-acad-undefun  (read (strcat "C:" commandname)))

Lee Mac

  • Seagull
  • Posts: 12912
  • London, England
Re: Delete Command with name stored in Variable
« Reply #3 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).

mailmaverick

  • Bull Frog
  • Posts: 493
Re: Delete Command with name stored in Variable
« Reply #4 on: April 16, 2019, 10:49:38 AM »
Excellent Vovka !!!!