Author Topic: Invalid option keyword  (Read 3670 times)

0 Members and 1 Guest are viewing this topic.

2e4lite

  • Guest
Invalid option keyword
« on: May 17, 2014, 10:23:19 PM »
      ...
      (setq ent (ssname ss n))
     ...
      (command "chprop" ent "" "la" lay_chname "")
 
   It runs successfully in cad2004,but in cad2009, prompting Invalid option keyword,why?


Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Invalid option keyword
« Reply #1 on: May 17, 2014, 10:39:13 PM »
Perhaps the command prompt sequence has changed ... if all other things are equal.
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

2e4lite

  • Guest
Re: Invalid option keyword
« Reply #2 on: May 17, 2014, 10:54:56 PM »
If I operate  step by step  in  the command line by this sequence,It is also successful
« Last Edit: May 17, 2014, 11:22:43 PM by 2e4lite »

Lee Mac

  • Seagull
  • Posts: 12912
  • London, England
Re: Invalid option keyword
« Reply #3 on: May 18, 2014, 06:21:19 AM »
Try:
Code: [Select]
(command "_.chprop" ent "" "_layer" lay_chname "")

2e4lite

  • Guest
Re: Invalid option keyword
« Reply #4 on: May 18, 2014, 07:35:32 AM »
Thanks Kerry and  Lee Mac !

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: Invalid option keyword
« Reply #5 on: May 20, 2014, 06:42:57 AM »
      ...
      (setq ent (ssname ss n))
     ...
      (command "chprop" ent "" "la" lay_chname "")
 
   It runs successfully in cad2004,but in cad2009, prompting Invalid option keyword,why?


Try:
Code: [Select]
(command "_.chprop" ent "" "_layer" lay_chname "")
Moral of the story ... never use shortcuts for options when calling them from Lisp (use the full option's name). You can be nearly 100% sure something will change again if any new option is added in a later version, and the chance that that "something" is the shortcut is very high - while the name is much less probable.
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.