TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Andrea on December 11, 2004, 06:01:18 PM

Title: command / vl-cmdf
Post by: Andrea 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..
Title: command / vl-cmdf
Post by: Jeff_M 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?
Title: command / vl-cmdf
Post by: Mark on December 11, 2004, 06:59:39 PM
Yep! there is forum for lisp type questions. :D
Title: command / vl-cmdf
Post by: SMadsen 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.
Title: command / vl-cmdf
Post by: Andrea 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.  ;-)