Author Topic: How to change command in DCL ?  (Read 1938 times)

0 Members and 1 Guest are viewing this topic.

aaa120

  • Guest
How to change command in DCL ?
« on: April 25, 2014, 04:47:52 AM »
I want to change command name in DCL's edit_box(Assuming the command name is "itmaxnew")
If I type string "abc" in  DCL's edit_box ,when I type "abc" and "return" ,it will run the  "itmaxnew" command.
If I type string "def" in  DCL's edit_box ,when I type "def" and "return" ,it will run the  "itmaxnew" command.
......
How  can I achieve this function?

(defun c:itmaxnew()(alert "change command"))
« Last Edit: April 25, 2014, 04:53:37 AM by aaa120 »

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: How to change command in DCL ?
« Reply #1 on: April 25, 2014, 07:02:10 AM »

So you want to run the same command for both cases, yes ??


What does your code look like?
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.

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: How to change command in DCL ?
« Reply #2 on: April 25, 2014, 10:08:41 AM »
A few questions:
  • When you say "return" is this like pressing the OK button - because if there is a default button pressing return/enter might just do this.
  • Or should the command run each time the edit_box's contents is edited then showing the dialog as it was again?
  • What is the significance of what's typed into the edit_box? E.g. is there anything different then abc is typed in from def? Or should the command simply be run the same way no matter what's inside the edit_box?
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.

PKENEWELL

  • Bull Frog
  • Posts: 317
Re: How to change command in DCL ?
« Reply #3 on: April 25, 2014, 11:42:49 AM »
(defun c:itmaxnew()(alert "change command"))

If you are attempting simply to notify the user via an alert box when a new command is entered into the Edit box, then the command must be included in the (Action_tile) statement for the Edit_Box:

Code: [Select]
;; Example - use your Edit-Box key and variable in place of "(Edit-Box Key goes here)" and "new-value".
(action_tile "(Edit-Box Key goes here)"
   "(setq new-value $value)(c:itmaxnew)"
)

Also - if your not calling (c:itmaxnew) as a user command at the command line, it does not need the "C:" prefix.

Please let me know if I am interpreting you correctly.
"When you are asked if you can do a job, tell 'em, 'Certainly I can!' Then get busy and find out how to do it." - Theodore Roosevelt