Results 1 to 4 of 4

Thread: acaddoc.lsp + revision

  1. #1
    Active Member
    Join Date
    2007-02
    Location
    Calgary, Alberta, Canada
    Posts
    73
    Login to Give a bone
    0

    Arrow acaddoc.lsp + revision

    Hey guys!

    What I'm trying to do is relieve some of the pressure on the IT Group in my company. Right now, when we have spec files and such to copy to our CAD program (CADWorx Plant), I call the IT Group and they change the revision number in the company log-off script for the CAD package, and then when certain people log-off, it copies the files from the network, to their local drive.

    So I already have the code which can copy the files (2 lisp files):

    Code:
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;; 
    ;; José Luis García Galán. 25/09/07, www.HISPACAD.com 
    ;; 
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;Abrir Vlisp Extensión AtiveX:
    (vl-load-com)
    ;;---------------------- CopyDir2Dir ------------------------------------------
    ;;Sample Use: 
    ;; (CopyDir2Dir "F:\\Pruebas\\Cocina\\" "F:\\Pruebas\\CocinaBis" "*.lsp") 
    ;;-----------------------------------------------------------------------------
    (defun CopyDir2Dir (sourceDir destinationDir PatFiles / filesInSource)
    (setq sourceDir (strcat (vl-string-right-trim "\\" sourceDir) "\\"))
    (setq destinationDir (strcat (vl-string-right-trim "\\" destinationDir) "\\"))
    ;;Test sourceDir
    (if (findfile (strcat sourceDir "."))
    (if (setq filesInSource (vl-directory-files sourceDir))
    (progn
    ;;Test destinationDir
    (if (not (findfile (strcat destinationDir ".")))
    (if (not (vl-mkdir destinationDir))
    (progn (alert (strcat "Destination Dir: " destinationDir "\n\nwas not possible to be created."))(exit))
    );c.if
    );c.if
    ;;Process copy files:
    (mapcar (function (lambda (file / fileNumber)
    (if (setq fileNumber (vl-file-copy (strcat sourceDir file) (strcat destinationDir file)))
    (prompt (strcat "\n" (itoa fileNumber) " -> " (strcat destinationDir file) " -> OK."))
    (if (findfile (strcat destinationDir file))
    (prompt (strcat "\nAlert -> " (strcat destinationDir file) " -> the file exists."))
    (prompt (strcat "\nError -> " (strcat destinationDir file) " -> was not possible to be copied."))
    );c.if
    )
    )) filesInSource);c.mapcar
    );c.prg
    (alert (strcat "Source Dir: " sourceDir "\n\ndoes not contain files: " PatFiles))
    );c.if
    (alert (strcat "Source Dir: " sourceDir "\n\ndoes not exist."))
    );c.if
    (princ)
    );c.defun
    (princ)
    Code:
    (CopyDir2Dir "\\\\teprog\\Programs\\CAD\\Mechanical\\CADWorx Specs" "C:\\CADWorx Plant 2009\\Spec" "*")(princ)
    (CopyDir2Dir "\\\\teprog\\Programs\\CAD\\Mechanical\\CADWorx Specs\\Config Files" "C:\\CADWorx Plant 2009\\Spec\\Config Files" "*")(princ)
    (CopyDir2Dir "\\\\teprog\\Programs\\CAD\\Mechanical\\CADWorx Specs\\DUVERNAY" "C:\\CADWorx Plant 2009\\Spec\\DUVERNAY" "*")(princ)
    (CopyDir2Dir "\\\\teprog\\Programs\\CAD\\Mechanical\\CADWorx Specs\\ENCANA" "C:\\CADWorx Plant 2009\\Spec\\ENCANA" "*")(princ)
    (CopyDir2Dir "\\\\teprog\\Programs\\CAD\\Mechanical\\CADWorx Specs\\ENCANA (BISSETTE)" "C:\\CADWorx Plant 2009\\Spec\\ENCANA (BISSETTE)" "*")(princ)
    (CopyDir2Dir "\\\\teprog\\Programs\\CAD\\Mechanical\\CADWorx Specs\\ENCANA (GORDONDALE)" "C:\\CADWorx Plant 2009\\Spec\\ENCANA (GORDONDALE)" "*")(princ)
    (CopyDir2Dir "\\\\teprog\\Programs\\CAD\\Mechanical\\CADWorx Specs\\PENN WEST" "C:\\CADWorx Plant 2009\\Spec\\PENN WEST" "*")(princ)
    (CopyDir2Dir "\\\\teprog\\Programs\\CAD\\Mechanical\\CADWorx Specs\\TEAL" "C:\\CADWorx Plant 2009\\Spec\\TEAL" "*")(princ)
    Anyways, I have acaddoc.lsp on all the CAD workstations local drives which loads another lisp file off the network everytime a drawing is opened. It sets up page setups, plot stamp stuff and loads other lisp files, etc etc.

    Code:
    (vl-load-com)
    (princ)
    (princ (load "J:\\CAD\\Mechanical\\Startup\\TEAL Mods - Mechanical.lsp" "\nTEAL Mods - Mechanical.lsp file not loaded."))
    (c:tealmods)
    (princ)
    What I want to do is be able to add a number on a new line in the acaddoc.lsp file, and then have the same number in my TEAL Mods - Mechanical.lsp file. When I change the number (revision) in the TEAL Mods file, it will read the line in acaddoc.lsp and see there is a difference in revision numbers, then copy all my files I want from the network to the local drives, and then update the revision number in acaddoc.lsp.

    So............anyone up for a small challenge?

  2. #2
    The Silent Type RobertB's Avatar
    Join Date
    2000-01
    Location
    Seattle WA USA
    Posts
    5,859
    Login to Give a bone
    0

    Default Re: acaddoc.lsp + revision

    May I propose an alternative?

    Have a single text-based file that stores the update date, .e.g.:
    Last Update.txt
    2008-08-18
    <eof>

    In the login script, have the following:
    fc /L "C:\Acad\Code\Last Update.txt" "P:\Acad\Code\Last Update.txt">nul
    if errorlevel 1 goto updatecode
    if errorlevel 0 goto noupdate
    :updatecode
    echo Please wait while updating customizations
    rmdir /s /q "C:\Acad\Code"
    xcopy "P:\Acad\Code" "C:\Acad\Code" /E /I /Q /R /Y
    :noupdate

    Note that every time you edit the server-based text file, the file compare (fc) will trigger an update the next time the user logs in.
    R. Robert Bell
    Design Technology Manager
    Stantec
    Opinions expressed are mine alone and do not reflect the views of Stantec.

  3. #3
    Active Member
    Join Date
    2007-02
    Location
    Calgary, Alberta, Canada
    Posts
    73
    Login to Give a bone
    0

    Default Re: acaddoc.lsp + revision

    If I could make a lisp file do that, that would be awesome!

  4. #4
    The Silent Type RobertB's Avatar
    Join Date
    2000-01
    Location
    Seattle WA USA
    Posts
    5,859
    Login to Give a bone
    0

    Default Re: acaddoc.lsp + revision

    Quote Originally Posted by mikelf View Post
    If I could make a lisp file do that, that would be awesome!
    You probably don't want a lisp file doing that. Why? Because by the time the lisp file executes, the updated code already needs to be in place. Login is the best time to do it.

    If IT is concerned about running the script on non-CAD users, all they need to do is check for AutoCAD being installed on the computer and skip the check if it isn't installed.
    R. Robert Bell
    Design Technology Manager
    Stantec
    Opinions expressed are mine alone and do not reflect the views of Stantec.

Similar Threads

  1. 2014: Revision Schedule, Triangle (graphic) shows only if revision is present in titleblock
    By boyd.johnson679667 in forum Revit Architecture - Families
    Replies: 0
    Last Post: 2014-11-12, 06:13 PM
  2. Halftone option for showing revision clouds within revision manager.
    By Wish List System in forum Revit Architecture - Wish List
    Replies: 0
    Last Post: 2011-12-02, 04:22 PM
  3. Revision Clouds line weight different per Revision
    By billy007nh in forum Revit Architecture - General
    Replies: 7
    Last Post: 2010-11-18, 05:55 PM
  4. acaddoc.lsp
    By ted.evans in forum AutoCAD General
    Replies: 4
    Last Post: 2010-01-22, 07:10 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •