Author Topic: "load" wants a shape file instead of LISP routine  (Read 138 times)

0 Members and 1 Guest are viewing this topic.

jhadams82

  • Mosquito
  • Posts: 11
"load" wants a shape file instead of LISP routine
« on: July 10, 2017, 06:41:21 pm »
I have one main LISP routine that, at the end, wants to open a DWG and change some text, save it and close it.  But once you open a new DWG, the LISP routine stops.  So from what I can tell, I need to run a script that will open the drawing and load a separate LISP routine that will make my changes.  Here's my script file:

_.open "P:/CSDG AutoCAD Civil/Lisp Routines/Justin/field test3/Xrefs/16-128-01_border_24x36.dwg" _.load "P:/CSDG AutoCAD Civil/Lisp Routines/Justin/field test3/Xrefs/border_text_from_file.lsp" _.qsave _.close

But when I run it, the LISP routine isn't executed and I get a prompt at the console that says "Enter name of shape file to load".  First off, I don't even know what a shape file is (something to do with fonts?).  Second, I do know it's not what I want or, as far as I know, what "load" should be looking for.  If I use APPLOAD to run the LISP routine manually (instead of from inside the script), it works fine.

It's starting to look like this command just recently changed.  Every webpage and forum post I can find says "load" is for LISP files but apparently that's not the case any more.  Is there some command line form of "appload" I should be using?  Did Autodesk just break my program?  There's got to be a way to load a LISP file from the command line, why can't I find it?!?   :x

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16614
  • Superior Stupidity at its best
Re: "load" wants a shape file instead of LISP routine
« Reply #1 on: July 10, 2017, 11:03:58 pm »
"load" can be used in two different ways.
The first way is on the command line as a command. It loads shape files. Your script is using that load function.

The other way is to load a lisp file. That is a lisp command and can only be differentiated by enclosing it in parenthesis.

Thus

_.load "P:/CSDG AutoCAD Civil/Lisp Routines/Justin/field test3/Xrefs/border_text_from_file.lsp"

is expecting "P:/CSDG AutoCAD Civil/Lisp Routines/Justin/field test3/Xrefs/border_text_from_file.lsp" to be a shape file

whereas

(load "P:/CSDG AutoCAD Civil/Lisp Routines/Justin/field test3/Xrefs/border_text_from_file.lsp")

will expect a lisp file.
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

jhadams82

  • Mosquito
  • Posts: 11
Re: "load" wants a shape file instead of LISP routine
« Reply #2 on: July 11, 2017, 10:03:01 am »
wow, really?  ...hm, yeah really.  geez, i never would have figured that out.

Thanks very much.  And don't ever let Mark shut this place down.  It's a godsend when you need it.