rsawall Posted November 20, 2012 Posted November 20, 2012 I am quite rusty with code but this routine has the characteristics I am looking for. I have tried modifying the code without success. What I am looking to do is read the network connection and load an autocad profile if connected and another if not. Can anyone help? The StartupSuite is known to have bugs in some versions - it is far more reliable to use the ACADDOC.lsp to load programs on startup. Resullins, here is a short explanation of the flow of the code: (setq S::STARTUP (append S::STARTUP AecCStartup)) [color=green];; Unknown, since we don't know what the AecCStatup function is.[/color] (princ "Starting Load") (princ "Network Check... ") (if (findfile "L:/library/cadmasters/acadsta/acad/lisp/network.up") [color=green] ;; If the above file is found:[/color] (progn (princ "OK.\n") (defun ETload (parm / full_filename) (setq full_filename (strcat "L:/library/cadmasters/ACADSTA/ACAD/LISP/" parm)) (if (findfile (strcat full_filename ".lsp")) (load full_filename) (princ (strcat "AutoLISP File (" full_filename ") Not Found\n")) ) (princ) ) [color=green] ;; Define the 'ETload' function as above[/color] ) (progn (princ "\nServer DOWN... Resetting LISP To C: Drive... ") (getstring "Press <RETURN> To Acknowledge Problem: ") [color=green] ;; Else define a 'whload' function as follows:[/color] (defun whload (parm / full_filename) (setq full_filename (strcat "C:/ACAD/LISP/" parm)) (if (findfile (strcat full_filename ".lsp")) (load full_filename) (princ (strcat "AutoLISP File (" full_filename ") Not Found\n")) ) (princ) ) ) ) [color=green];; However, the ETLoad function is called anyway, regardless of whether the above ;; condition is met.[/color] (ETload "Earth-Tech") The problem could be fixed by renaming the 'whload' function to 'ETload'. 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.