mdbdesign Posted May 26, 2010 Posted May 26, 2010 Never did it before: Need button macro that will open file (dwg) and execute one lisp command in it. It is possible just something very simple? Thank you in advance. Quote
Lee Mac Posted May 26, 2010 Posted May 26, 2010 How about putting the LISP file in the ACADDOC.lsp to run when loaded, and click open Quote
mdbdesign Posted May 26, 2010 Author Posted May 26, 2010 Lee I will need it only for one dwg. I don't need it to load with every start up. That is the problem. Start file execute lisp and that it for few weeks and start over again. It must be done in same way always but I think I or somebody will not remember it after time. Quote
alanjt Posted May 26, 2010 Posted May 26, 2010 You could load a script from the button to open a specific file and execute commands. Quote
alanjt Posted May 26, 2010 Posted May 26, 2010 Not exactly what you want, but in your program shortcut, you can add /f "FILe.dwg" and it will open autocad with that file. Quote
mdbdesign Posted May 26, 2010 Author Posted May 26, 2010 Thing is: somebody with 0.0000001% knowledge of AutoCAD will use it most of the time to update dwg. Need it foul proof. just one click and done. Quote
alanjt Posted May 26, 2010 Posted May 26, 2010 Sounds like a script is the answer or put it in the acaddoc file that if a filename matches the specific file, run the lisp on it. Quote
mdbdesign Posted May 26, 2010 Author Posted May 26, 2010 Or just change with 0.0000001% knowledge of AutoCAD will use it to 1% will work. It is possible. Quote
MarcoW Posted May 26, 2010 Posted May 26, 2010 If you have made yourself a button, then add a macro in there like this: ^C^C^Pmylisp; Of course "mylisp" is an example function in the lisp file itself. Thats for the button... Create and save the lisp in one of the autocad support file search paths. You can see where they are or add the folder where your lisp is stored: options>first tab>support file search paths>add>browse to your location. Now in this same folder create a file called acaddoc.lsp. In this file you put 1 line:' (autoload "FILENAME" '("mylisp" "mylispifIhad2namesforit") Well all this should do what you need. Much credit to Alanjt and others who have helped me a lot with this. Quote
mdbdesign Posted May 26, 2010 Author Posted May 26, 2010 End up with script. Its working. Looks like my coworker like it and now I got question how to pick up phone with script? No comment. 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.