mgonzales Posted September 24, 2009 Share Posted September 24, 2009 At my Co. we have many drawings that have several xref scales in the list and i also wanted to purge all the regapps, but i wanted it to run everytime i load a drawing so here is what i did in the acaddoc.lsp (setq oldfiledia (getvar "FILEDIA")) ;Save value of FileDia system variable (setvar "FILEDIA" 0) ;Set FileDia to 0 to use command prompt only (command "_SCRIPT" "P:\\Cad\\Script\\New Script\\scalelist.scr") ;Run the script (command "_SCRIPT" "F:\\Documents\\lisp\\lsp\purgereapps.scr") ;Run the script (setvar "FILEDIA" oldfiledia) ;Set FileDia back to previous value (setq oldfiledia nil) ;Clear variable used for FileDia please help. thanks Quote Link to comment Share on other sites More sharing options...
Freerefill Posted September 25, 2009 Share Posted September 25, 2009 Scripts are a weird beast. You can only one run at once, but that's not the only thing. If you have a LISP running, the script will sort of run at the same time as the LISP, which will throw both off. Furthermore, you can't have two scripts running at once. I know, all computer code wisdom tells you "linear progression from start to finish", but that's not how it works when you have a script and a LISP or more than one script. One suggestion is to put in a sort of "while loop delay," and define a variable (say, "continue_1, continue_2" and so on) at the end of your script. You can create a loop like: (while (not continue_1)) Which will do absolutely nothing until "continue_1" is defined (which will only happen when your script ends), at which point the LISP will continue, and you can run your next script. You could also try combining them into one script. I hope that helps. ^.^ Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.