Author Topic: Run a lisp without "C:Command"?  (Read 6181 times)

0 Members and 1 Guest are viewing this topic.

kdub_nz

  • Mesozoic keyThumper
  • SuperMod
  • Water Moccasin
  • Posts: 2123
  • class keyThumper<T>:ILazy<T>
Re: Run a lisp without "C:Command"?
« Reply #15 on: July 20, 2016, 12:03:12 AM »

Hi Trogg

The final line would need to be  (C:CPR), surely ?
Called Kerry in my other life
Retired; but they dragged me back in !

I live at UTC + 13.00

---
some people complain about loading the dishwasher.
Sometimes the question is more important than the answer.

trogg

  • Bull Frog
  • Posts: 255
Re: Run a lisp without "C:Command"?
« Reply #16 on: July 20, 2016, 03:04:24 PM »

Hi Trogg

The final line would need to be  (C:CPR), surely ?

I'm sorry, I should have made that more clear.

Don't remove the defined command at the top of the lisp. Leave that alone.
The only thing that I change in the routine is adding the command wrapped in parentheses at the end of the routine.

Updated in 2023...
I totally missed kerry's point with my response. Yes. The C: is included before the command as Kerry pointed out.
I have updated the image to be correct (after all these years...)

~Greg
« Last Edit: March 10, 2023, 12:02:32 PM by trogg »

ahsattarian

  • Newt
  • Posts: 112
Re: Run a lisp without "C:Command"?
« Reply #17 on: March 10, 2023, 09:29:54 AM »
Hi,

If you save the following code as runscript.lsp and you drag and drop this file from the explorer into the AutoCAD window the expression will evaluate.

Code - Auto/Visual Lisp: [Select]
  1. (if (findfile "C:/path/yourscript.scr")
  2.   (command "_script" "C:/path/yourscript.scr")
  3. )

I've Checked other file names and can say that every file name acts the same as     runscript   .

Every lisp file acts when drag and droped in AutoCAD.