Author Topic: question regarding script and lisp running (together)  (Read 3671 times)

0 Members and 1 Guest are viewing this topic.

stsevedallas

  • Guest
question regarding script and lisp running (together)
« on: June 13, 2006, 09:01:55 AM »
If I run this in a script...

(load "cloud.lsp") (load "layerdate.lsp") layerdate cloud

It loads both.
It runs "layerdate", then stops.
"Cloud" does not run.
WTF?

stsevedallas

  • Guest
Re: question regarding script and lisp running (together)
« Reply #1 on: June 13, 2006, 09:08:23 AM »
I even tried this change in the script...

(load "cloud.lsp") (load "layerdate.lsp") (c:layerdate) (c:cloud )

same thing...

Didge

  • Bull Frog
  • Posts: 211
Re: question regarding script and lisp running (together)
« Reply #2 on: June 13, 2006, 09:13:58 AM »
Try this:

layerdate;cloud;

(a semi-colon emulates a carriage return)
Think Slow......

stsevedallas

  • Guest
Re: question regarding script and lisp running (together)
« Reply #3 on: June 13, 2006, 09:21:01 AM »
";" just put all of that on the command line
nothing...
I put [enter] in the script after each...
nothing.

There is something that I am missing here.
Why does is stop the script before it finishes?
Hmmmmm...

stsevedallas

  • Guest
Re: question regarding script and lisp running (together)
« Reply #4 on: June 13, 2006, 09:23:24 AM »
When I type these on the command line, they work just as they should.
So, why not in a script?

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Re: question regarding script and lisp running (together)
« Reply #5 on: June 13, 2006, 10:16:48 AM »
Ok, first things first ...
In a script, if you call a lisp routine that requires user interaction, makes use of "command" or vl-cmdf, or if the lisp generates any error, the script will cease running.
secondly, if you insist upon running scripts that make use of command or vl-cmdf (I think there are a few others, but I cannot remember them at this time), you must edit your lisp routines to be able to interact with scripts.
Finally, you CAN make a simple change to your lisps to make them compatable, but it does not always work and can sometimes create unexpected results.

To fix them so they will work properly, edit the "layerdate" routine to include AS THE LAST LINE in the lisp
Code: [Select]
(vl-cmdf "_.RESUME")

Your scripts will operate as you expect, however, if there is a script that has been interrupted, it will begin execution from where it was interrupted, after running this lisp.

Example ...
You have a script that automates plotting .... after pressing enter, you realize you forgot to change something in the drawing .. rather than plot the things all out and throw them away, you press the ESC key to stop the script. You then begin editing the drawing, and find yourself in need of using the "layerdate" routine. As soon as you run the routine, the resume command is issued and suddenly, inexplicably, the plotting starts up where it left off when you previously cancelled it ...

So, you see it is not a silver bullet, but it will resolve the immediate issue at hand.
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

stsevedallas

  • Guest
Re: question regarding script and lisp running (together)
« Reply #6 on: June 13, 2006, 10:27:29 AM »
Thanks

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
Re: question regarding script and lisp running (together)
« Reply #7 on: June 13, 2006, 10:59:36 AM »
what version of autocad?  in 2006, for some STUPID IDIOTIC REASON, Autodesk broke scripts.  I know, it seems like thats impossible, but I logged it as a bug and they admitted to breaking it.  Add an extra "space" at the end of your line.  Sounds stupid, but they confirmed it.
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

Slim©

  • Needs a day job
  • Posts: 6566
  • The Dude Abides...
Re: question regarding script and lisp running (together)
« Reply #8 on: June 13, 2006, 02:21:45 PM »
Add an extra "space" at the end of your line.  Sounds stupid, but they confirmed it.

What reason did they give for adding the "extra" space?
I drink beer and I know things....

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
Re: question regarding script and lisp running (together)
« Reply #9 on: June 13, 2006, 02:35:31 PM »
it functions like a return.  even though its not needed b/c the real "return" to the next line is there, the scr file needs it.  When I logged it, the tech at AD was amazed b/c "supposedly" the code for scripting hasn't been touched since R13 or something like that.  Maybe it was 14, but either way, I can t believe they broke it
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)