Lisp routine gone wrong in 2005

Discussion in 'AutoCAD' started by Bob Mitchell, Jun 24, 2004.

  1. Bob Mitchell

    Bob Mitchell Guest

    Hello,
    I have successfully used this lisp routine in AutoCAD 2000-2002:

    (defun C:VRC ()
    (command "view" "restore" "P")
    (setq c-cmd (getvar "cmdecho"))
    (setvar "cmdecho" 0)
    (setq a (ssget))
    (setq b (getpoint "\Pick base point: "))
    (setvar "cmdecho" c-cmd)
    (command "zoom" "previous")
    (command "copy" a "" "m" b
    ))

    However, when using it in 2005, it changes the layer state and I must use layerp or lman to reset the layer state.

    Any help would be appreciated.

    Thanks, Bob Mitchell
     
    Bob Mitchell, Jun 24, 2004
    #1
  2. Bob Mitchell

    ECCAD Guest

    I am no expert on Views, but R2005 has several new options.
    To see the options: (command "view")<enter>
    I would think you could use 'A' and 'S'ave on the named view.
    e.g. (command "_view" "A" "<viewname>" "S" "")
    then,
    (command "_view" "restore" "<viewname>")

    Bob
     
    ECCAD, Jun 24, 2004
    #2
  3. Bob Mitchell

    Bob Mitchell Guest

    Thanks for the insight.
    I'll check and see if that is the source of the problem.
    Bob
     
    Bob Mitchell, Jun 24, 2004
    #3
  4. Bob Mitchell

    ECCAD Guest

    Bob,
    If you find a 'cure' I'm sure that others may be interested.

    Bob
     
    ECCAD, Jun 24, 2004
    #4
  5. Bob,

    How are you creating the view? Views can _optionally_ save layers settings.

    (command "._view" "_s" "P" "" "_A" "P" "_D" "")


    --
    R. Robert Bell


    Hello,
    I have successfully used this lisp routine in AutoCAD 2000-2002:

    (defun C:VRC ()
    (command "view" "restore" "P")
    (setq c-cmd (getvar "cmdecho"))
    (setvar "cmdecho" 0)
    (setq a (ssget))
    (setq b (getpoint "\Pick base point: "))
    (setvar "cmdecho" c-cmd)
    (command "zoom" "previous")
    (command "copy" a "" "m" b
    ))

    However, when using it in 2005, it changes the layer state and I must use
    layerp or lman to reset the layer state.

    Any help would be appreciated.

    Thanks, Bob Mitchell
     
    R. Robert Bell, Jun 25, 2004
    #5
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.