Routine works on one computer but not another

Discussion in 'AutoCAD' started by Mark Godfrey, Aug 20, 2003.

  1. Mark Godfrey

    Mark Godfrey Guest

    I have this routine that works on one but not the other. When I try to run
    it, I get this: _FSV ; error: bad argument type: lselsetp nil The _FSV is
    the command. Here is the routine:

    ;| FINAL_SAVE.LSP by Paul Kirill 9/19/2002 c2002 KDCAD, inc.

    This routine is given freely and may be freely distributed with the
    condition
    that all KDCAD copyright and contact information be included.

    If you have any questions or would like to contract for additional
    customization, please drop me a note at !


    Type FSV to execute.

    How it works: FINAL_SAVE first looks for your title block. If found
    in Model Space, the routine Zooms to the limits of the drawing,
    verifies the drawing has been previously saved and if so runs
    QSAVE. If the title block is found in Paper Space, the routine
    cycles through each tab, locks the viewports and Zooms to Extents.
    Once the cycle is comlete, the routine "parks" on the 1st layout
    tab, checks for a previous and if so runs QSAVE.

    Notes: You must change the default titleblock name. See the second line
    of code below.

    If the drawing has not been previously saved (ex. Drawing1.dwg),
    an alert message is triggered and the routine quits.


    |;

    ;; BEGIN FINAL_SAVE**************************************************

    (defun C:FSV (/ LST FLEN FNUM MODE FILENAME)

    (setq SRCH_BLOCK "1717sheetinfo")
    ;;***Replace "1717sheetinfo" with your titleblock name

    (defun CHECK_FILE_NAME ()
    (setq FILENAME (getvar "dwgname")
    FLEN (strlen FILENAME)
    FNUM (substr FILENAME 1 (- FLEN 5))
    )
    (if (= FNUM "Drawing")
    (progn
    (alert
    "Drawing not saved in standard format! \n\n Save drawing in standard
    format
    \n before running Final Save."
    )
    (princ)
    )
    (progn
    (command "QSAVE")
    (if (= MODE 1)
    (princ
    (strcat
    "All layouts have been Zoomed to Extents \nand drawing "
    FILENAME
    " has been saved."
    )
    )
    (princ
    (strcat
    "Model Space has been Zoomed to Limits \nand drawing "
    FILENAME
    " has been saved"
    )
    )
    )
    )
    )
    (princ)
    )

    (defun CHECK_SPACE (/ SPCCHK)
    (setq SPCCHK (ssget "x"
    (list (cons 0 "INSERT") (cons 2 SRCH_BLOCK))
    )
    SPCCHK (entget (ssname SPCCHK 0))
    )
    (setq MODE (cdr (assoc 67 SPCCHK)))
    (if (= MODE 1)
    (PSFSV)
    (MSFSV)
    )
    )

    (defun MSFSV ()
    (C:ZL)
    (CHECK_FILE_NAME)
    (PRINC)
    )

    (defun PSFSV (/ layouts c)
    ;;---------------Putting Layout Tabs in Order - Coutesy of Frank
    Oquendo - ACADX.com
    (vl-load-com)
    (setq layouts (vla-get-layouts
    (vla-get-activedocument (vlax-get-acad-object))
    )
    c -1
    )
    (repeat (vla-get-count layouts)
    (setq lst (cons (setq c (1+ c)) lst))
    )
    (vlax-for lay layouts
    (setq lst
    (subst
    (vla-get-name lay)
    (vla-get-taborder lay)
    lst
    )
    )
    )
    (setq LTLIST (reverse lst))

    ;;^^^^^^^^^^^^^Putting Layout Tabs in Order - Coutesy of Frank Oquendo -
    ACADX.com

    (setq ZOOMLIST LST)
    (while ZOOMLIST
    (setvar "CTAB" (car ZOOMLIST))
    (if (/= (getvar "CTAB") "Model")
    (C:VL)
    )
    (command "ZOOM" "E")
    (setq ZOOMLIST (cdr ZOOMLIST))
    )
    (setvar "CTAB" (car (cdr LTLIST)))
    (CHECK_FILE_NAME)
    )

    (CHECK_SPACE)
    )

    ;; END FINAL_SAVE**************************************************



    ;;MVIEW LOCK
    (defun C:VL (/ VPLST)
    (setq VPLST (ssget "x" (list (cons 0 "viewport"))))
    (if (= (getvar "ctab") "Model")
    (princ "\n** Command not allowed in Model Tab **")
    (command "MVIEW" "lock" "on" VPLST "")
    )
    (princ)
    )


    ;;Zoom Limits
    (defun C:ZL (/ PT1 PT2)
    (setq PT1 (getvar "LIMMIN"))
    (setq PT2 (getvar "LIMMAX"))
    (command "ZOOM" "W" PT1 PT2)
    (princ)
    )

    I have seen Paul on here before, maybe he knows what it is or maybe someone
    else could take a shot at it. Thanks.
     
    Mark Godfrey, Aug 20, 2003
    #1
  2. Mark Godfrey

    Mark Godfrey Guest

    Anyone have anything on this one? Would be much appreciated.
     
    Mark Godfrey, Aug 21, 2003
    #2
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.