Help me hunt down my error

Discussion in 'AutoCAD' started by kemp, Jul 12, 2004.

  1. kemp

    kemp Guest

    I wrote a layer handling script and for the most part it works. However
    there are a few drawings (maybe 1%) that crash.

    I get this error:

    ;error: Exception occurred: 0xC0000005 (Access Violation)

    with this alert:
    FATAL ERROR: Unhandled Access Violation Reading 0x6c617624 Exception at
    65176876h

    How can I make it catch the errors and tell me what they are so I can
    try and figure out why these specific drawings are not working? the
    portion of the script that is failing uses regular lisp, no vl.


    I believe the following function may be the culprit, but I am not yet sure:

    (if (/= LayerColor "-")
    (progn
    (if (= LayerFreeze "thaw")
    (command "T" layer)
    (command "F" layer))
    (command "C" LayerColor layer)
    (if (/= LayerLineType "Continuous")
    (command "LT" LayerLineType layer))
    (if (= LayerLock "unlock")
    (command LayerLock layer))
    (if (/= LayerLineWeight ".010")
    (command "LW" LayerLineWeight layer))
    (if (= 0 (getvar "PSTYLEMODE"))
    (command "PS" LayerPlotStyle layer))
    (if (= LayerPlot "noplot")
    (command "P" LayerPlot layer))))

    thanks for any help - kemp
     
    kemp, Jul 12, 2004
    #1
  2. I didn't see anything inherently wrote with the lisp file.
    When it fails, it is probably because one of the variables is set to nil.
    When I get frustrated with an error, I sometimes will add a princ statement
    to show the values.
    set SHOWVALS to T, when the program crashes to find the variable set to nil.
    (if CHECKERROR
    (progn
    (princ "\nLayer = ")(princ Layer)
    (princ "\nLayerFreeze = ")(princ LayerFreeze)
    (princ "\nLayerColor = ")(princ LayerColor)
    (princ "\nLayerLineType = ")(princ LayerLineType)
    (princ "\nLayerLock = ")(princ LayerLock)
    (princ "\nLayerLineWeight = ")(princ LayerLineWeight)
    (princ "\nLayerPlotStyle = ")(princ LayerPlotStyle)
    (princ "\nLayerPlot = ")(princ LayerPlot)
    )
    )
     
    Alan Henderson @ A'cad Solutions, Jul 12, 2004
    #2
  3. kemp

    kemp Guest

    Thanks for both of your help. They are actually making me work right now
    so I won't be able to test out your suggestions for a couple of days but
    I will certainly post my findings later.

    Thanks again, kemp
     
    kemp, Jul 13, 2004
    #3
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.