leos98 Posted April 9, 2009 Posted April 9, 2009 Hello to everyone, How can I run multiple LISP files from one macro button. For this example I would like to list LISP1, LISP2 and LISP3 as examples for any routines I may have. Can I create a new button and the in the macro part of the button just type: (load "LISP1");LISP1;(load "LISP2");LISP2;(load "LISP3");LISP3; My questions about this are: would my macro run each of the routines one after the other or would it try to run all three at the same time? Is this the proper way of doing things or should everything be combined into one LISP? Your help is greatly appretiated. Thanks, Quote
JohnM Posted April 9, 2009 Posted April 9, 2009 look at the autoload function and look at the startup suite in the appload dialoag box Quote
Lee Mac Posted April 9, 2009 Posted April 9, 2009 As John said, look into the start-up suite or ACADDOC.lsp for loading the files, (makes things easier) - as for running them, I don't see why that wouldn't work. Quote
RevAaron Posted April 9, 2009 Posted April 9, 2009 would my macro run each of the routines one after the other or would it try to run all three at the same time? (load "LISP1");LISP1;(load "LISP2");LISP2;(load "LISP3");LISP3; Neither- That would only run LISP1- nothing else would happen. You have the rest of the line commented out with the semicolon that starts with ;LISP1;. If you take out the comments and make it: (load "LISP1")(load "LISP2")(load "LISP3") It would work, and it would run each one after another. If you're worried about it, being explicit doesn't hurt... (progn (load "LISP1") (load "LISP2") (load "LISP3")) I do something like this in one of my scripts- I paste the entire line into AutoCAD's command window, and I want to make sure it takes the entire group of instructions and runs them one after another. Quote
Lee Mac Posted April 9, 2009 Posted April 9, 2009 Neither- That would only run LISP1- nothing else would happen. You have the rest of the line commented out with the semicolon that starts with ;LISP1;. I don't work with macros much, but I thought that semi-colons ( didn't count as comments in macros, they are used much in the same way as spaces - to signify an "enter". Quote
leos98 Posted April 9, 2009 Author Posted April 9, 2009 I don't work with macros much, but I thought that semi-colons ( didn't count as comments in macros, they are used much in the same way as spaces - to signify an "enter". That is correct, semi-colons do the same as spaces. Also, I do not really know how to work with the ADCADDOC.lsp, that is why I do not mess with it. However, I did find out is that when I loaded the lsp files in the CUI menu, under slip files; I only need to run them with out loading them. Is this true? can somebody confirm? What I want to know is if after the lsp files have been loaded, then executing the macro: ^C^CLISP1;LISP2;LISP3 will run one LISP1 wait for it to be done and the run LISP2, wait and the run LISP3? or, would the macro try to execute all of the lsp routines even if the previous one is not done running? Thanks! Quote
Lee Mac Posted April 9, 2009 Posted April 9, 2009 That is correct, semi-colons do the same as spaces. Also, I do not really know how to work with the ADCADDOC.lsp, that is why I do not mess with it. However, I did find out is that when I loaded the lsp files in the CUI menu, under slip files; I only need to run them with out loading them. Is this true? can somebody confirm? What I want to know is if after the lsp files have been loaded, then executing the macro: ^C^CLISP1;LISP2;LISP3 will run one LISP1 wait for it to be done and the run LISP2, wait and the run LISP3? or, would the macro try to execute all of the lsp routines even if the previous one is not done running? Thanks! The macro will run as any script or LISP will - executing the functions one after the other as they appear in the program. If you don't want to use the ACADDOC.lsp, just add the LISP files to the startup suite - much easier Quote
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.