strange error when running the lisp

strange error when running the lisp

sam_safinia
Advocate Advocate
971 Views
12 Replies
Message 1 of 13

strange error when running the lisp

sam_safinia
Advocate
Advocate

I was running a routine for a while but I receive weired error since yesterday. It look some variable setting has changed which I cannot find it.

After running my lisp, when it comes to this line:

 

(command ".style" "Standard" "simplex" (* 1.000 1.000) "1" "0" "n" "n" "n")

 

it pops up text style window and asking to select fonts etc. but previously was automatic and when I close it I get this error:

 

Command: Standard Unknown command "STANDARD". Press F1 for help.
Command: simplex Unknown command "SIMPLEX". Press F1 for help.

 

Thanks for your help

 

0 Likes
Accepted solutions (1)
972 Views
12 Replies
Replies (12)
Message 2 of 13

Satoews
Advocate
Advocate
(command "-style" "Standard" "simplex" (* 1.000 1.000) "1" "0" "n" "n" "n")

Try this it should suppress the window. 

 

The error your getting is the lisp is trying to use standard and simplex as their own commands instead of part of styles command.

Shawn T
0 Likes
Message 3 of 13

sam_safinia
Advocate
Advocate
Then how can i get back it to normal? thanks
0 Likes
Message 4 of 13

Satoews
Advocate
Advocate

 

 

(command "-style" "Standard" "simplex" (* 1.000 1.000) "1" "0" "n" "n" "n")

 

 

Try replacing the code you have for the code i posted above. 

Shawn T
0 Likes
Message 5 of 13

sam_safinia
Advocate
Advocate

Sorry, but I cannot see any difference between two codes.....

0 Likes
Message 6 of 13

Satoews
Advocate
Advocate
".style" will not suppress the window "-style" should suppress that window.
Shawn T
0 Likes
Message 7 of 13

sam_safinia
Advocate
Advocate
Ok thanks
0 Likes
Message 8 of 13

Satoews
Advocate
Advocate

Appologies I was doing that all from my phone, your lisp was getting confused by the window. It paused the lisp while the window is active and restarted again when it was closed. That is why you got the wierd errors. Usually you can suppress that window prompt and run the command off the command line  with a "-yourcommandhere" instead of a "_.yourcommandhere". This will in turn use the rest of the lisp and make your style command automatic again. Hope this is what you were looking for =).

Shawn T
0 Likes
Message 9 of 13

Kent1Cooper
Consultant
Consultant

@Tornac wrote:
".style" will not suppress the window "-style" should suppress that window.

That's not the issue.  That's true for dialog-box command names when typed in at the Command line, but within an AutoLisp (command) function, the dialog box will be suppressed, without the need for the hyphen, unless you precede the (command) function with (initdia) to force the dialog box to be used.  [I don't suppose your code has suddenly acquired an (initdia) function that it didn't have before....]  You can include the hyphen if you want, but it won't be what solves the problem -- something else is going on [perhaps the phone issue mentioned elsewhere?].

 

The original post describes errors consistent with the .STYLE command name not being recognized, since it would then go on and try to take Standard and Simplex as command names, which would explain the error messages mentioned.  Was there also an unknown-command error message about the Style command?  With the preceding period/decimal, that can't be explained by its merely having been Undefined, so there would seem to be some deeper problem.  When I paste that code into the Command line in Acad2016, it works fine, and without the dialog box coming up.

Kent Cooper, AIA
Message 10 of 13

Satoews
Advocate
Advocate

My appologies, kent is correct. I got confused due to some commands not haveing a hyphen ability and my knowledge in script told me to hyphen that command. =P

Shawn T
0 Likes
Message 11 of 13

dbroad
Mentor
Mentor

Unless something happened to break AutoCAD so that it does not recognize the style command, your error is probably at an earlier point in the program so that ".style" might be interpreted as an option or entry to the last prompt of a previous command.  I also have no idea why the (* 1.000 1.000) is included in the command.  A simple 1 would do better.  To cancel any pending command, you should be able to use an empty command function.

 

(command)

(command ".style" ....)

 

but it would be better to find the problem unless this is the first command statement in the program.

Architect, Registered NC, VA, SC, & GA.
0 Likes
Message 12 of 13

sam_safinia
Advocate
Advocate
As Kent says there should be another issue somewhere because it was
supersing the window before. It's in the middle of my code and let you know
guys if I found it. Thanks
0 Likes
Message 13 of 13

sam_safinia
Advocate
Advocate
Accepted solution

I could not find the variable that has benn changed by mistake. I reset my AutoCAD settings to default and then it solved the issue!

 

Thanks for the help

0 Likes