daveyboyd Posted January 18, 2010 Posted January 18, 2010 Hi, I have had this lisp routine for a while now and it works great however I have to load it manually in every drawing by typing >REAON / >REAOFF. Can anyone tell me what to add/do to make it load automatically? Here is the code : AUTO.LSP Quote
Lee Mac Posted January 18, 2010 Posted January 18, 2010 You could add a call to REAON in your ACADDOC.lsp: (c:REAON) Quote
asos2000 Posted January 18, 2010 Posted January 18, 2010 In command line type APPLOAD then follow the attached Quote
daveyboyd Posted January 20, 2010 Author Posted January 20, 2010 I have the lisp routine in my briefcase already. The problem is that to invoke the comand reactors I have to type >REAON once the drawing is open. I want it so I dont have to do this and the command reactors are always on. Lee - I tried putting the command line in the acad2010doc.lsp but it didnt work? Here is where i put it . . . ;;;===== AutoLoad LISP Applications ===== ; Set help for those apps with a command line interface (setfunhelp "c:gotourl" "" "gotourl") (autoload "edge" '("edge")) (setfunhelp "C:edge" "" "edge") (autoload "reaon" '("reaon")) (setfunhelp "C:reaon" "" "reaon") (autoload "3d" '("3d" "3d" "ai_box" "ai_pyramid" "ai_wedge" "ai_dome" "ai_mesh" "ai_sphere" "ai_cone" "ai_torus" "ai_dish") Is this right? Quote
Lee Mac Posted January 20, 2010 Posted January 20, 2010 Firstly, I wouldn't recommend altering the ACAD2010doc.lsp for various reasons, but rather the ACADDOC.lsp Also, you need to add this: (c:REON) As posted earlier. Quote
rkmcswain Posted January 20, 2010 Posted January 20, 2010 Rule 1 = Avoid the startup suite, period. Rule 2 = Don't edit "acad20xxdoc.lsp" or "acad20xx.lsp". These files belong to the application. Create/edit the user files named "acad.lsp" and "acaddoc.lsp" Quote
daveyboyd Posted January 21, 2010 Author Posted January 21, 2010 Sorry fellas, I dont seem to have an acad.lsp acaddoc.lsp file in my autocad directory, excuse me if I sound mega thick by the way, do I have to create one? What do I put in it etc etc Quote
daveyboyd Posted January 21, 2010 Author Posted January 21, 2010 Oh, I have now changed my acad2010doc.lsp file back to normal, thanks Quote
rkmcswain Posted January 21, 2010 Posted January 21, 2010 Sorry fellas, I dont seem to have an acad.lsp acaddoc.lsp file in my autocad directory You won't by default. These are user created and maintained files. The application won't touch these files during a repair, reinstall, upgrade, etc. You can put anything in there you want. "Acad.lsp" is executed once per session of AutoCAD, at startup. "acaddoc.lsp" is executed each time a drawing is opened. Generally, "Acad.doc" is used to set things that don't change between drawings, while "acaddoc.lsp" is used to set drawing specific things and to load lisp files. If you want to use the (command) function at startup, you should use the special function (S::STARTUP) All of this is covered in more detail in HELP. Quote
guitarguy1685 Posted January 21, 2010 Posted January 21, 2010 I usually just add something like this to the very end of my acad2007doc.lsp file (load "C:/mylisps/AUTO.lsp")obviously you use whatever path your lisp is in. and don't forget to reverse the "\" to "/" . I'm not sure you even need the .lsp part but I put it in anyways. the acad20xxdoc.lsp file runs everytime you open/start a new drawing the acad20xx.lsp only runs when you start Autocad. Quote
rkmcswain Posted January 21, 2010 Posted January 21, 2010 I usually just add something like this to the very end of my acad2007doc.lsp file the acad20xxdoc.lsp file runs everytime you open/start a new drawing the acad20xx.lsp only runs when you start Autocad. But there is NO reason to use these files. They are subject to being overwritten during a repair, reinstall, upgrade, etc. - and assuming your content survives, you have to cut/paste your changes each time you move to a new version. Forget about editing these files and use the files that are set aside for the user: "acad.lsp" and "acaddoc.lsp" ...and don't forget to reverse the "\" to "/" . I'm not sure you even need the .lsp part but I put it in anyways. You can either use a forward slash or two backslashes (load "\\\\server\\share\\mylisp") -or- (load "//server/share/mylisp") ...and you don't need the .lsp, unless you want to specifically load it (in case you have other files with the same name but different extension, like .VLX or .FAS) Quote
daveyboyd Posted January 21, 2010 Author Posted January 21, 2010 Thanks Mcswain and apologies for being a biff! Quote
daveyboyd Posted January 21, 2010 Author Posted January 21, 2010 Sorry to be a pain but I have created acad.lsp and put (C:REAON) in it and made sure that it is loaded every drawing but I still have to type >REAON on the command bar to activate the lisp Quote
rkmcswain Posted January 21, 2010 Posted January 21, 2010 Sorry to be a pain but I have created acad.lsp and put (C:REAON) in it and made sure that it is loaded every drawing but I still have to type >REAON on the command bar to activate the lisp "acad.lsp" is only loaded at application startup. If you want this code to run each time a drawing is loaded, make sure to put the call in "acaddoc.lsp" Quote
Lee Mac Posted January 21, 2010 Posted January 21, 2010 Some related Threads: http://www.theswamp.org/index.php?topic=9211.0 http://www.theswamp.org/index.php?topic=20492.0 http://www.cadtutor.net/faq/questions/53/How+do+I+automatically+load+variables%3F Quote
guitarguy1685 Posted January 22, 2010 Posted January 22, 2010 But there is NO reason to use these files. They are subject to being overwritten during a repair, reinstall, upgrade, etc. - and assuming your content survives, you have to cut/paste your changes each time you move to a new version. Forget about editing these files and use the files that are set aside for the user: "acad.lsp" and "acaddoc.lsp" You can either use a forward slash or two backslashes (load "\\\\server\\share\\mylisp") -or- (load "//server/share/mylisp") ...and you don't need the .lsp, unless you want to specifically load it (in case you have other files with the same name but different extension, like .VLX or .FAS) well the lisps are not lost just the lines that call them to load. I don't have hundreds of lisps loaded. I have about 10. I rarely reinstall autocad or have to repair it. If I have to retype 10 lines every year or so I don't consider it a hassle. but to each his own. Quote
LEsq Posted January 22, 2010 Posted January 22, 2010 Rule 1 = Avoid the startup suite, period. What are the side effects? I use nowadays a single lisp file - that I loaded that way, with a few routines that use on a daily basis... Quote
LEsq Posted January 22, 2010 Posted January 22, 2010 I have the lisp routine in my briefcase already. The problem is that to invoke the comand reactors I have to type >REAON once the drawing is open. I want it so I dont have to do this and the command reactors are always on. Lee - I tried putting the command line in the acad2010doc.lsp but it didnt work? Here is where i put it . . . ;;;===== AutoLoad LISP Applications ===== ; Set help for those apps with a command line interface (setfunhelp "c:gotourl" "" "gotourl") (autoload "edge" '("edge")) (setfunhelp "C:edge" "" "edge") (autoload "reaon" '("reaon")) (setfunhelp "C:reaon" "" "reaon") (autoload "3d" '("3d" "3d" "ai_box" "ai_pyramid" "ai_wedge" "ai_dome" "ai_mesh" "ai_sphere" "ai_cone" "ai_torus" "ai_dish") Is this right? If this is for reactors... there is a way to auto load the routine automatically and only to the drawing that have the reactors used... Now, I need to do a search here on my pc, to know where I left that code... it was a single code line - no need to any known means of autoloading a lisp routine btw. If I found it, will post it here. Quote
rkmcswain Posted January 22, 2010 Posted January 22, 2010 What are the side effects? No way to automate the list of files. No way to migrate this list from machine to machine, from version to version, or even from windows profile to windows profile. No way to populate this list on multiple machines No way to manage this list on multiple machines etc. etc. (Ok, technically, if you are proficient with the windows registry and registry scripts, you could do these things, but who wants to when there is a much easier way..?) I guess if you are a solo operator, with a single install, and had zero experience with autolisp, then I could understand.. but it's not like creating a text file with load statements (the "acaddoc.lsp" file) is rocket science. Quote
rkmcswain Posted January 22, 2010 Posted January 22, 2010 well the lisps are not lost just the lines that call them to load. I don't have hundreds of lisps loaded. I have about 10. I rarely reinstall autocad or have to repair it. If I have to retype 10 lines every year or so I don't consider it a hassle. but to each his own. I understand what you are saying. Maybe it would make more sense to say it this way "There is no reason to NOT use the user files" (acad.lsp and acaddoc.lsp). 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.