Author Topic: command / vl-cmdf  (Read 4722 times)

0 Members and 1 Guest are viewing this topic.

Andrea

  • Water Moccasin
  • Posts: 2372
command / vl-cmdf
« on: December 11, 2004, 06:01:18 PM »
ok all..

a good one...

why when i use this is not working ?
(vl-cmdf "_insert" "test.dwg" ^c)

I need to use the "command" line option to get it work.
(command "_insert" "test.dwg" ^c)

just curious..
Keep smile...

Jeff_M

  • King Gator
  • Posts: 4096
  • C3D user & customizer
command / vl-cmdf
« Reply #1 on: December 11, 2004, 06:13:30 PM »
"The arguments to the vl-cmdf function can be strings, reals, integers, or points, as expected by the prompt sequence of the executed command. A null string ("") is equivalent to pressing ENTER on the keyboard. Invoking vl-cmdf with no argument is equivalent to pressing ESC and cancels most AutoCAD commands. "

So that means this will work:
Code: [Select]

(vl-cmdf "_insert" "c:/test1.dwg")
(vl-cmdf)


BTW, you do know there is a seperate forum for lisp type queries?

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
command / vl-cmdf
« Reply #2 on: December 11, 2004, 06:59:39 PM »
Yep! there is forum for lisp type questions. :D
TheSwamp.org  (serving the CAD community since 2003)

SMadsen

  • Guest
command / vl-cmdf
« Reply #3 on: December 13, 2004, 05:20:54 AM »
Andrea, just to elaborate a bit: the ^C you put at the end has no special meaning. It's just seen as a symbol that happens to evaluate to nil. Instead you should use nil in the COMMAND call.

The difference you experience is caused by the fact that VL-CMDF evaluates all arguments before passing them to the command interpreter. Verifying the entire package of arguments before executing the command is what makes VL-CMDF capable of returning T on success.
COMMAND on the other hand simply shoves arguments into the command interpreter while the command is being executed.

When VL-CMDF sees a nil value (e.g. in the form of the symbol ^C), it says 'this is a no go' and stops before the command is sent.

Andrea

  • Water Moccasin
  • Posts: 2372
command / vl-cmdf
« Reply #4 on: December 13, 2004, 07:06:28 PM »
Quote from: SMadsen
Andrea, just to elaborate a bit: the ^C you put at the end has no special meaning. It's just seen as a symbol that happens to evaluate to nil. Instead you should use nil in the COMMAND call.

The difference you experience is caused by the fact that VL-CMDF evaluates all arguments before passing them to the command interpreter. Verifying the entire package of arguments before executing the command is what makes VL-CMDF capable of returning T on success.
COMMAND on the other hand simply shoves arguments into the command interpreter while the command is being executed.

When VL-CMDF sees a nil value (e.g. in the form of the symbol ^C), it says 'this is a no go' and stops before the command is sent.


OH !!  I see now...
thank you all.
i appreciate all your help.  ;-)
Keep smile...