Open file and run lisp - macro
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. How about putting the LISP file in the ACADDOC.lsp to run when loaded, and click open 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. You could load a script from the button to open a specific file and execute commands. Not exactly what you want, but in your program shortcut, you can add
and it will open autocad with that file. 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. 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. Or just change
to 1% will work. It is possible. 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. Load/AutoLoad Usage
页:
[1]
2