Author Topic: "Unknown Command" Error  (Read 2282 times)

0 Members and 1 Guest are viewing this topic.

bfred805

  • Guest
"Unknown Command" Error
« on: December 19, 2014, 07:48:48 PM »
Hello:

I recently developed a LISP and would like it to automatically load into AutoCAD. I've done this numerous times before but this time I am getting errors.

From the Command Line:
Command: (findfile "acaddoc.lsp")
"C:\\program files\\autodesk\\acad_config\\lisp\\acaddoc.lsp"
Command: (findfile "sendtoserver.lsp")
"C:\\program files\\autodesk\\acad_config\\lisp\\sendtoserver.lsp"



I made sure that I have an entry in my acaddoc.lsp file for:
(load "sendtoserver.lsp")

and that my LISP folder is pathed and set as a trusted source in my support file options.

Any thoughts?

I should also note, that if I manually type (load "sendtoserver.lsp") at the command line ACAD only returns:
(Command: sendtoserver.lsp)

instead of the file location as well, which it typically includes.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: "Unknown Command" Error
« Reply #1 on: December 19, 2014, 08:12:32 PM »
Make a lisp source file named Testit.lsp

Code - Auto/Visual Lisp: [Select]
  1.  
  2. ;; TESTIT.lsp
  3. (defun testit ()
  4.  
  5.    (princ)
  6.  
  7. )
  8.  

Add it to the same location as sendtoserver.lsp

type this at the command line
(load "testit.lsp")

What happens ?



added:
The title of this thread is
"Unknown Command" Error
You don't mention that in the body of the post.

When are you getting this error message ?
« Last Edit: December 19, 2014, 08:36:07 PM by Kerry »
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.

bfred805

  • Guest
Re: "Unknown Command" Error
« Reply #2 on: December 22, 2014, 05:06:36 PM »
That testit.lsp code works fine. As do some of the other LISP's that are loaded in the acaddoc.lsp file.

Here is my code:

(defun c:syncfromserver ()
   (command "_.shell" "\"C:\\Program Files\\Autodesk\\ACAD_Config\\File Sync\\mirrorservertolocal.ffs_batch\"")
   (alert "Files have been downloaded from server!")
   (princ)
)
(princ)

When I type the command in AutoCAD or click the button that I created upon restarting the program - my command line returns:

Command: SYNCFROMSERVER Unknown command "SYNCFROMSERVER".

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: "Unknown Command" Error
« Reply #3 on: December 22, 2014, 05:28:30 PM »
That testit.lsp code works fine. As do some of the other LISP's that are loaded in the acaddoc.lsp file.

<... >

Does that mean that 'Some' don't load ?
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.

bfred805

  • Guest
Re: "Unknown Command" Error
« Reply #4 on: December 22, 2014, 06:24:00 PM »
"Some" means all but this one that is in question.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: "Unknown Command" Error
« Reply #5 on: December 22, 2014, 07:37:59 PM »

I assume the complete file is loading without error.
I have no sensible ideas to solve the issue.


Perhaps add something like this to the end of the file being loaded.
Code - Auto/Visual Lisp: [Select]
  1. (defun c:syncfromserver ()
  2.    (command "_.shell" "\"C:\\Program Files\\Autodesk\\ACAD_Config\\File Sync\\mirrorservertolocal.ffs_batch\"")
  3.    (alert "Files have been downloaded from server!")
  4.    (princ)
  5. )
  6. (princ "\n      'syncFromServer' has been loaded")
  7.  
  8.  

This should display the message to the commandLine at startup.

I must say that (as described) this is a really weird problem. 
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.