Nested error trapping used incorrectly.

Discussion in 'AutoCAD' started by Bruce Card, Dec 18, 2003.

  1. Bruce Card

    Bruce Card Guest

    I get the message "Nested error trapping used incorrectly." when I try to
    use mcopy in a drawing which was created with the following lisp. The
    problem ceases if I close the drawing and reopen it.

    The intent of the program is to produce a 2D block to represent a complex
    assembly, which was drawn with solids and blocks containing solids, for
    insertion onto a floor plan. It is therefore unlikely that it will ever be
    edited. -- BUT -- I hate to leave a bug running around loose.

    I am sure that something in my lisp is causing this but I can't for the life
    of me see what it could be. Has anyone got any idea what I did wrong.

    (defun C:2D (/ i layouts cnt lst layout bc-a bc-b bc-c)
    (command "saveas"
    ""
    (strcat (getvar "dwgprefix") "2D-" (getvar "dwgname"))
    "y"
    "tilemode" "0"
    )
    (vl-load-com)
    (setq i -1
    layouts (vla-get-layouts
    (vla-get-activedocument (vlax-get-acad-object))
    )
    cnt (1- (vla-get-count layouts))
    lst cnt
    )
    (repeat (- cnt 1)
    (vlax-for layout layouts
    (if (= (vla-get-taborder layout) lst)
    (vla-delete layout)
    )
    )
    (setq lst (- lst 1))
    )
    (command "mspace" "-layer" "t" "*" "u" "*"
    "")
    (setq bc-a (ENTNEXT))
    (while bc-a
    (setq bc-b (entget bc-a))
    (if (= "INSERT" (cdr (assoc 0 bc-b)))
    (command "EXPLODE" bc-a)
    )
    (setq bc-c bc-a)
    (setq bc-a (entnext bc-a))
    (if (= bc-c bc-a)
    (setq bc-a nil)
    )
    )
    (command "_pspace" "erase" "all" "" "solview"
    "u" "w" "" "0,0" "" "0,0"
    "10.5,8" "_2d" "" "_mspace" "_zoom" "e"
    "soldraw" "all" "" "-layer" "f" "_2d-vis"
    "" "_mspace" "erase" "all" "" "-layer"
    "t" "_2d-vis" "s" "0" "" "_pspace" "erase" "all"
    "" "tilemode" "1" "chprop" "all" "" "la" "0" ""
    )
    (repeat 2 (command "Purge" "a" "*" "n"))
    (princ)

    )
     
    Bruce Card, Dec 18, 2003
    #1
  2. Bruce Card

    Bruce Card Guest

    Can I assume, since I have received no reply to this post, that there are at
    least no obvious errors in my code?
     
    Bruce Card, Dec 20, 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.