Jump to content

Recommended Posts

Posted

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'.

  • Replies 20
  • Created
  • Last Reply

Top Posters In This Topic

  • Lee Mac

    6

  • GWelch

    5

  • alanjt

    3

  • resullins

    3

Top Posters In This Topic

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...