Jump to content

Quick script question


Recommended Posts

Posted

Simple question:

 

Is it possible to run a script from within another script? So I could have a series of short scripts, and then one other script that called & ran all the other ones? And if so, how??

Posted

only sort of. You can call a script from another BUT you cannot return to the point you left in the one that did the calling.

Posted

Thanks for the reply.

 

What I want is for one script to run all my other ones. So say I have 4 scripts called 1, 2, 3, 4. I then want one 'master' script which just calls the other scripts in order. That's it.

Posted

As I implied above (after editing) I haven't found a way using simply scripts. I took the sledghammer approach (as I often do) and created a VB program that would stick together the script bits to produce a single but long script containing all the elements. It may be possible to construct a LISP routine that calls scripts but my LISP is too rusty to even try.

 

2009 has the scripting built in so there may be possibilities there but I haven't installed 2009 yet so don't know for certain.

Posted
It may be possible to construct a LISP routine that calls scripts but my LISP is too rusty to even try.

 

Would anyone be able to help me here? dbroada's LISPing may be rusty, but mine's non-existant! Thanks

Posted

Could you elaborate on what is the type of script and what is does. Some people refer to all automation as a "script" (menu macros, lips, etc..), whereas the term should be reserved for "script" files (.scr extension) run with the "script" command.

 

If you always want them all run at once, you could just combine them into 1 file. if you want user input to run one or more other script file, you'd need a front-end lisp routine or similar.

Posted
Could you elaborate on what is the type of script and what is does. Some people refer to all automation as a "script" (menu macros, lips, etc..), whereas the term should be reserved for "script" files (.scr extension) run with the "script" command.

 

Nope - this is a script-proper (.scr)

 

If you always want them all run at once, you could just combine them into 1 file

 

I have my script all as one file at the moment, with slight variations depending on what scale my drawing is to be plotted at. What I want is when I edit the script, to just edit it once and not have to copy it to my other scripts with the different scales. For example, I have one section that corrects a load of common spellings. At the moment this section is repeated three times in each of my other scripts with the different scales. So what I want to do is to have the spelling section as a separate script that the others call, therefore meaning that when I add to/edit it I only do it once. I can then also just running the spelling script on its own if I want to without everything else happening.

Posted

Thinking a bit more I'm not sure that you can return to a calling LISP routine. The script runs as if you had typed it from the command line. I'm not sure what you need to type to return to the calling routine.

 

It may be possible to set up a counter so that each script calls the LISP and each time the LISP is called it increments the counter and calls a different script.

 

I know its longer but I would tend to run script1 on all my drawings, then script2 etc.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...