CADgirl Posted January 19, 2010 Posted January 19, 2010 I need help with loading a lisp routine. There was a guy who used to work at our company and he had this lisp routine that had all of our layers and symbols. Recently my hard drive crashed and so now I'm back on the computer with nothing loaded. I have the files that seem to be what I need, but I don't know how to load them. Well, I know how to load a basic lisp routine but I can't seem to get it to work the same way he did. So maybe I just need to learn from the beginning. I don't know how to load icons and pull down menus. Any help would be greatly appreciated! Thank you. Quote
wkplan Posted January 19, 2010 Posted January 19, 2010 maybee this is a start... regards Wolfgang Quote
ReMark Posted January 19, 2010 Posted January 19, 2010 The guy you speak of may have used acaddoc.lsp or acad.lsp to load the custom lisp routines used in your office. Did something happen to your AutoCAD icons and pull-down menus or are you talking about custom items? Quote
CADgirl Posted January 19, 2010 Author Posted January 19, 2010 He might have used acad.lsp. There is a lsp file with that name. This is what it says- (LOAD "DATESAV") (setvar "coords" 2) (setvar "cmdecho" 0) (setvar "menuecho" 0) (setvar "regenmode" 1) (setvar "texteval" 0) (setvar "unitmode" 1) ;;=================================== ACAD.LSP================================= ;;Copyright © 1997 SELLECT Designs, Inc. ;; (load "sellect.mnl") ;; ;; ;;============================================================================== ;; Function Usage : (setlts) ;; Function Purpose : Sets current LTSCALE to a given factor of "sellvd" which ;; is the intended plotting scale ratio. For example, if the intended plot ;; scale is 1/8"=1' or 1=96, then ltscale is set to 96 times the value below. ;; (defun setlts () (setvar "ltscale" (* 1.0000 sellvd))) ;; ^^^^^^ ;; adjust the above number to change the multiplier for LineTypeSCALE, ;; or, disable the function with a ";" at the beginning of the (defun...) line. ;; ;; ;;============================================================================== ;; Function Usage : (setsnap) ;; Function Purpose : Sets current SNAP value to a given factor of "sellvd" which ;; is the intended plotting scale ratio. For example, if the intended plot ;; scale is 1/8"=1' or 1=96, then the snap value is set to 96 times the value below. ;; (defun setsnap (/ a) (setq a (* 0.125 sellvd)) (setvar "snapunit" (list a a))) ;; ^^^^^ ;; adjust the above number to change the multiplier for Snap, ;; or, disable the function with a ";" at the beginning of the (defun...) line. ;; ;; ;; (progn (if (setq a (findfile "sellect.lsp")) (setq a (load a) a nil) (princ "\n>>FILE [sELLECT.lsp] NOT FOUND! Sellect disabled. Only ACAD.LSP ") ) (princ) ) (load "sdmcleon") (defun c:TE (/ ok_button text_set countr dcl_id ent old new edata diastat ) (load "ai_utils") (defun ok_button () (setq new (get_tile "text_edit")) (done_dialog 1) ) (setq text_set (ssget '((0 . "TEXT")))) (if text_set (progn (setq countr 0) (setq dcl_id (load_dialog "ddmedit.dcl")) (repeat (sslength text_set) (setq new nil) (setq ent (ssname text_set countr)) (setq edata (entget ent)) (redraw ent 3) (setq old (cdr (assoc 1 edata))) (if (not (new_dialog "ddmedit" dcl_id)) (exit) ) (set_tile "text_edit" old) (action_tile "accept" "(ok_button)" ) (action_tile "cancel" "(done_dialog 0)" ) (setq diastat (start_dialog)) (cond ( (zerop diastat)) ( (not new)) ( (eq "" (ai_strtrim new))) ( (eq new old)) (t (entmod (list (cons -1 ent) (cons 1 new))))) (setq countr (1+ countr)) (redraw ent) ) (unload_dialog dcl_id) ) (prompt "\nNo text entities selected.") ) (prin1) ) ;PICK LAYER TO TURN OFF (defun C:LYO (/ A B) (setq A (entsel "\nPick an object on the layer to be turned off") B (cdr (assoc '8 (entget (car A)))) LLST (cons B LLST) ) (command "LAYER" "OFF" B "") ) ;PICK LAYER ON XREF TO TURN OFF (defun c:LYOX (/ ) (setq ln (cdr (assoc 8 (entget (car (nentsel)))))) (command "layer" "off" ln "") (princ) ) ;CHANGE LAYER (defun c:lyc () (prompt "\nSelect the entities you want to change: ") (setq ss (ssget)) (prompt "\nPick an entity on the target Layer: ") (setq name (cdr (assoc 8 (entget (car (entseL)))))) (command "chprop" ss "" "La" name "") (princ) ) ;Qsave (Defun C:Q () (^C^C_qsave) ) Sorry I didn't specify it, the icons and pull dowm menus are custom. All the other standard stuff is fine. Currently in my support fle search path there are some files loaded, I'm not sure what that means. They are the files that have the lisp routines. Quote
ReMark Posted January 19, 2010 Posted January 19, 2010 Looks like the file contains several lisp routines. Invoke a routine from your command line and it should work. AutoCAD 2007 I believe used the CUI. It would have to be editted to include any custom items created. Quote
Lee Mac Posted January 19, 2010 Posted January 19, 2010 To be honest, it is better to use the ACADDOC.lsp file, as it is loaded every time you open a new drawing. The ACAD.lsp is only loaded when AutoCAD is loaded I believe. type this at the command line: (findfile "ACADDOC.lsp") If it returns nil, then you can create your own ACADDOC.lsp in notepad and save it as a LSP file in your support path, else alter the existing one. To load the LISP file, just include a statment like this in the ACADDOC.lsp (load "lispfilename.lsp") Or, if the lisp file you want to load is not in your support path, include the full filename using double backslashes: (load "C:\\Users\\CADGirl\\LISPs\\myLISP.lsp") more info here: http://www.theswamp.org/index.php?topic=30946.msg364983#msg364983 http://www.cadtutor.net/faq/questions/53/How+do+I+automatically+load+variables%3F Hope this helps! Lee Quote
CADgirl Posted January 19, 2010 Author Posted January 19, 2010 Thank you guys! How do I load custom pull down menus and toolbars? Quote
CADgirl Posted January 19, 2010 Author Posted January 19, 2010 Thank you so much everyone! I finally figured it out. Quote
gile Posted January 19, 2010 Posted January 19, 2010 Hi, I purpose an experience about automatic LISP loading files. In a search path folder, create (or add to) some files: acad.lsp (alert "acad.lsp loaded") acaddoc.lsp (alert "search path acaddoc.lsp loaded") if you use an enterprise CUI create a same named MNL file or if you use acad.cui (or acad.mns) copy in acad.mnl (alert "main CUI MNL loaded") if you use some partial CUI or MNU/MNS file, create a same named MNL file (alert "partial CUI MNL loaded") More, in a folder containg some dwg file(s), create another acaddoc.lsp (alert "drawing folder acaddoc.lsp loaded") Then open a new AutoCAD session, you will see which files are loaded and the loading order. Try opening an new drawing (dwt) Try opening a drawing from the folder you added an acaddoc.lsp file... 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.