Author Topic: Work From Home Updater  (Read 1115 times)

0 Members and 1 Guest are viewing this topic.

capsochist

  • Newt
  • Posts: 24
Work From Home Updater
« on: May 27, 2020, 10:51:14 AM »
Hello!

I am facing an advanced AutoLISP problem that I am hoping my friends here at The Swamp may be able to help me work through.

The firm that I work at has both civil engineers and landscape architects who both use Civil 3D and for all intents and purposes operate the same. The only difference is the Civil Engineers have a pipe network that needs to be copied to their local machine and a network that needs to be mapped.

Currently, I have independent LISP files for these tasks, but have found that it is sometimes too much to ask for people to follow 3-5 steps when they have to navigate to a folder, run a .CMD file and then execute a LISP. So, for this reason, I am wondering how to consolidate a handful of shell commands into my LISP for support file search path configuration. Each line of .SHELL would ideally have its own command name (i.e. UPDATECV, UPDATELA, etc.) so that depending on the user discipline they can type 1 command that will perform the robocopy update as well as ensure support file paths are mapped correctly.

Like I mentioned, I already have the code independent of one another, I struggle with understanding how this could be combined. Here is a snipit of malformed attempt to assign each function as its own variable:

Code - Auto/Visual Lisp: [Select]
  1. (defun c:updateCAD ( updatela updatecv spconfig cvpipenetwork) ;;DEPENDING ON COMMAND CALLED, EXECUTE DISCIPLINE UPDATE PLUS SPCONFIG. IF CIVIL PLUS CVPIPENETWORK
  2.    
  3.      (setq
  4.             ;;Program Parameters;;
  5.             updatela ;;RUNS LD_LANDSCAPE.CMD ROBOCOPY IN BACKGROUND TO UPDATE LANDSCAPE FILES
  6.             (defun c:UPDATELA ()
  7.                   (command "_.shell" "\"Z:\\LD_CONFIG\\LD_FileSync\\LD_LANDSCAPE.cmd\"")
  8.                   (princ)
  9.             )
  10.  
  11.             updatecv ;;RUNS LD_CIVIL.CMD ROBOCOPY IN BACKGROUND TO UPDATE CIVIL FILES
  12.             (defun c:UPDATECV ()
  13.                   (command "_.shell" "\"Z:\\LD_CONFIG\\LD_FileSync\\LD_CIVIL.cmd\"")
  14.                   (princ)
  15.             )      
  16.  
  17.             cvpipenetwork ;;CONFIGURES CIVIL PIPE NETWORK CATALOG LOCATION
  18.             (defun c:cvpipenetwork ()  ;;INSERT LISP CODE FOR SUPPORT FILE SEARCH PATH HERE
  19.                   (princ)
  20.             )
  21.  
  22.             spconfig ;;CONFIGURES SUPPORT FILE PATH SETUPS
  23.             (defun c:SPCONFIG ()  ;;INSERT LISP CODE FOR SUPPORT FILE SEARCH PATH HERE
  24.                   (princ)
  25.             )
  26.  
  27. )

JohnK

  • Administrator
  • Seagull
  • Posts: 10646
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org