confused with command and command-s

Started by velasquez, November 05, 2014, 09:21:24 AM

Previous topic - Next topic

velasquez

I do not understand the problem with command and command-s
I copied the lines below the help of AutoCAD 2015.
"The following is an invalid use of prompting for user input with the command-s function.
(command-s "._circle" (getpoint "\nSpecify center point: ") "_d" 2.75)
"

Turns out the lines of code work fine in AutoCAD 2015 and 2012.
1

(command-s "._circle" (getpoint "\nSpecify center point: ") "_d" 2.75)

2

(command "._circle" (getpoint "\nSpecify center point: ") "_d" 2.75)


Can someone explain me better how to reproduce the error that is as reported.
I better understand all the comments about it.
Thanks
Modify message

owenwengerd

Are you typing this at the command prompt? Try putting it inside a lisp function that performs other UI after the call to (command), then run your lisp function.

velasquez

Quote from: owenwengerd on November 05, 2014, 01:32:07 PM
Are you typing this at the command prompt? Try putting it inside a lisp function that performs other UI after the call to (command), then run your lisp function.

Sorry Owen,
Yes I used the code from the command prompt.
I did not understand well your suggestion
Can you show me an example?

owenwengerd

I did a quick test and could not produce a problem with using (getpoint) in the argument list. The documentation implies that (command-s) is a "special form" lisp function, but that does not appear to be the case. It's possible that they changed it late in the development cycle.

velasquez

Quote from: owenwengerd on November 06, 2014, 11:15:34 AM
I did a quick test and could not produce a problem with using (getpoint) in the argument list. The documentation implies that (command-s) is a "special form" lisp function, but that does not appear to be the case. It's possible that they changed it late in the development cycle.

Thanks Owen,
GetPoint no problem with working with command and command-s there.

AutoDesk also says:
No "Pause" command tokens may be used. Expressions that interact with the drawing area or Command Window may be used, but will all be processed before AutoCAD receives and processes any of them.
The following is not valid with the command-s function:
But the below code works without problems.
(command-s "._line" "0,0" PAUSE "")

Fred Tomke

Hi, velasquez, I've unfortunately made the bad exerience the command, command-s, and vl-cmdf may also lead into VVC: internal error even if no OpenDCL was active.
So I started to rebuild my old lisp command calls either into ActiveX calls (as far as possible) or in C#. I urgently recommend you to rebuild your project until no command is used anymore :(
Regards, Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]