Need a push in the right direction with this one

Discussion in 'AutoCAD' started by bsteele, May 20, 2004.

  1. bsteele

    bsteele Guest

    My company has seen fit to record every 11x17 and 24x36 size AutoCad prints. And until a better system comes along (6mos. to 1 yr) It's my job to make this happen. Well anyway, I've created an Excel spreadsheet to have people printing to track what they have done. But you know people...sometimes they forget. well I'm trying to create a reminder at plotting to go to the excel spreadsheet. what I would like is to put a reminder after the plot window closes
    and give them a choice. If they took care of their responsibilities then move on, if not I would like to direct them to the spreadsheet automatically.

    I've started this lisp

    (command "undefine" "plot")
    (PRINC)
    (defun c:plot ()
    (alert "PLEASE REMEMBER TO FILL IN PRINTER/PLOTTER LOG....")
    (Command "redefine" "plot")
    (initdia)
    (command ".plot")
    (princ)
    (alert "DID YOU REMEMBER TO FILL IN PRINTER/PLOTTER LOG???")
    (PRINC)
    )

    problem 1. it only works once per drawing
    problem 2. it needs some kind of an if /and/or statement to
    tell the lisp program what/where to go.
    My expertise in lisp is limited. I've lurked and learned quite a bit about lisp stuff, but I think I'm over my head with this one. Sorry for being so long winded, any help would be appreciated. TIA
    Brad
     
    bsteele, May 20, 2004
    #1
  2. bsteele

    bsteele Guest

    i've also tried adding stuff like:
    (setq "y" nil)
    (setq "n" (startapp "c://microsoft office//office10//excel.exe)
    (prompt "\nY or N")
    I know i'm way off...please help
     
    bsteele, May 20, 2004
    #2
  3. bsteele

    Rudy Tovar Guest

    Fill in the blanks.


    ; Lisp Skeleton for Dialog: dialog1
    ;


    (vlr-editor-reactor
    nil
    '(:)vlr-commandended . testplot))
    )

    (defun testplot (func val / func_called val_list)
    (setq func_called func
    val_list (car val)
    )
    (if (= val_list "PLOT")
    (progn
    (if (= (getvar "diastat") 1)
    (progn
    (if (and
    (not (wcmatch (strcase (getvar"plotid")) "PRINTER*"))
    (not (wcmatch (strcase (getvar"plotid")) "REPRO*"))
    )
    (c:TESTPLOTPASS)
    )
    )
    )
    )
    )

    (princ)
    )

    --

    AUTODESK
    Authorized Developer
    http://www.Cadentity.com
    MASi

    prints. And until a better system comes along (6mos. to 1 yr) It's my job to
    make this happen. Well anyway, I've created an Excel spreadsheet to have
    people printing to track what they have done. But you know
    people...sometimes they forget. well I'm trying to create a reminder at
    plotting to go to the excel spreadsheet. what I would like is to put a
    reminder after the plot window closes
    move on, if not I would like to direct them to the spreadsheet
    automatically.
    lisp stuff, but I think I'm over my head with this one. Sorry for being so
    long winded, any help would be appreciated. TIA
     
    Rudy Tovar, May 20, 2004
    #3
  4. bsteele

    bsteele Guest

    would it be possible to direct the program to a "shortcut" on the desktop pointing to the spreadsheet in question?
     
    bsteele, May 20, 2004
    #4
  5. bsteele

    bsteele Guest

    Ok, I've managed to fix prob.1....any more help? TIA. I'll provide open source code for anyone who wants it when completed
     
    bsteele, May 20, 2004
    #5
  6. bsteele

    ECCAD Guest

    Or, just to fire-up the Existing .xls, you could do something like:
    (startapp "c:\\Program Files\\Microsoft Office\\Office\\Excel.exe"
    "G:\\apps\\Printer Utilization.xls")
    .....with proper pathes for your system.

    Bob
     
    ECCAD, May 21, 2004
    #6
  7. bsteele

    bsteele Guest

    This is what I finally came up with last night. you just half to have the excel program, the spreadsheet, and the lisp file all included on the file support path.
    It ain't pretty but here's what I came up with:

    (command "undefine" "plot")
    (PRINC)
    (defun c:plot ()
    (Command "redEfine" "plot")
    (initdia)
    (command ".plot")
    (princ)
    (command "undefine" "plot")
    (princ)
    (alert "DID YOU REMEMBER TO FILL IN PRINTER/PLOTTER LOG???")
    (startapp "excel.exe" "s:/cadd/printer_utilization")
    (PRINC)
    )

    seems to work well, any improvements are welcome. and thanks guy's, you rock!!
     
    bsteele, May 21, 2004
    #7
  8. bsteele

    bsteele Guest

    I really need to use that "what-do-you-call-it" spellcheck thingie........LOL
     
    bsteele, May 21, 2004
    #8
  9. bsteele

    ECCAD Guest

    And he grins
    :)
     
    ECCAD, May 21, 2004
    #9
  10. bsteele

    bsteele Guest

    now I seem to have a new problem. I can only make it work on my machine. Others get the Reminder alert box...but then nothing.....I guess I'll have to work out the dynamics of how the IT loaded Excel on everybody's confuser...Thanks again all.
     
    bsteele, May 21, 2004
    #10
  11. bsteele

    bsteele Guest

    what u did was help me out alot...I've gotten it to work on two 'puters today... had to plat with the front/back slashes
    but it works Exactly the way I needed it to. Thanks again to help figure out a very untypical solution to such a specific need. again, you da' man!!
     
    bsteele, May 24, 2004
    #11
  12. bsteele

    ECCAD Guest

    bsteele,
    You are very welcome.
    Bob
     
    ECCAD, May 24, 2004
    #12
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.