(command "undo" "begin") crashes A2005 sometimes...

Discussion in 'AutoCAD' started by James Maeding, Feb 25, 2005.

  1. I have written many complicated lisp routines for A2002 and they run fine.
    The same routines sometimes crash in A2005.

    I have narrowed it to the undo begin and end statements.
    Is there anything I should be doing to deal with the incredible sensitivity to this in A2005?

    I can give more info depending on what people say. I am first looking for any obvious things I need to be careful
    about.
    thanks
    James Maeding
    jmaeding at hunsaker dot com
    Civil Engineer/Programmer
     
    James Maeding, Feb 25, 2005
    #1
  2. James,

    Don't know... but remember the salad mix of autolisp with activex, stuff?... might be something to have a look.

    The other is to try to use pure activex to replace the command calls for undo.... or at minimum replace it with vl-cmdf...

    LE
     
    Luis Esquivel, Feb 25, 2005
    #2
  3. James Maeding

    Joe Burke Guest

    James,

    Have you seen this fatal error? INTERNAL ERROR: UNDOCMD 3. If so I might have an
    idea.

    Another question: does the crash occur while the program is running? Or only if you
    try to undo immediately after the program ends.

    Joe Burke
     
    Joe Burke, Feb 25, 2005
    #3
  4. None, aside from the fact that what the vla-* functions
    above are doing, is executing the UNDO Begin/End sub-
    commands via the internal equivalent of the (command)
    function, to acheive their goal.
     
    Tony Tanzillo, Feb 25, 2005
    #4
  5. Hi Joe,
    I have not seen that error, I just get FATAL ERROR blah blah....
    The crashes occur while the routines are running, from what I can tell.

    I will definately try the vl versions of undo begin and end, that would be too easy though, I'll cross my fingers.

    "Joe Burke" <>
    |>James,
    |>
    |>Have you seen this fatal error? INTERNAL ERROR: UNDOCMD 3. If so I might have an
    |>idea.
    |>
    |>Another question: does the crash occur while the program is running? Or only if you
    |>try to undo immediately after the program ends.
    |>
    |>Joe Burke
    |>
    |>>I have written many complicated lisp routines for A2002 and they run fine.
    |>> The same routines sometimes crash in A2005.
    |>>
    |>> I have narrowed it to the undo begin and end statements.
    |>> Is there anything I should be doing to deal with the incredible sensitivity to this
    |>> in A2005?
    |>>
    |>> I can give more info depending on what people say. I am first looking for any
    |>> obvious things I need to be careful
    |>> about.
    |>> thanks
    |>> James Maeding
    |>> jmaeding at hunsaker dot com
    |>> Civil Engineer/Programmer
    |>

    James Maeding
    jmaeding at hunsaker dot com
    Civil Engineer/Programmer
     
    James Maeding, Feb 25, 2005
    #5
  6. I seem to have solved the crashes, I noticed I had one (command "undo" "begin") without an end command.
    A2002 did not hang on this but A2005 does.
    I am seeing errors in my other routines now too where they end before issuing the undo end statement.

    I guess this is one way to phase out lisp, start making things sensitive to what used to be ok. Whether its on purpose
    or not, I guess its one way to do it.
    thx

    James Maeding <jmaeding at hunsaker dot com>
    |>I have written many complicated lisp routines for A2002 and they run fine.
    |>The same routines sometimes crash in A2005.
    |>
    |>I have narrowed it to the undo begin and end statements.
    |>Is there anything I should be doing to deal with the incredible sensitivity to this in A2005?
    |>
    |>I can give more info depending on what people say. I am first looking for any obvious things I need to be careful
    |>about.
    |>thanks
    |>James Maeding
    |>jmaeding at hunsaker dot com
    |>Civil Engineer/Programmer

    James Maeding
    jmaeding at hunsaker dot com
    Civil Engineer/Programmer
     
    James Maeding, Feb 25, 2005
    #6
  7. James Maeding

    James Allen Guest

    Simply postulating; perhaps the sensitivity is related to the added
    multiple-redo functionality?

    --
    James Allen, EIT
    Malicoat-Winslow Engineers, P.C.
    Columbia, MO


    "begin") without an end command.
    issuing the undo end statement.
    to what used to be ok. Whether its on purpose
    for any obvious things I need to be careful
     
    James Allen, Feb 25, 2005
    #7
  8. James Maeding

    Joe Burke Guest

    James Maeding,

    That's exactly what I intended to suggest. The following will crash, so don't try it
    with open working files.

    Using 2004 here.

    (defun c:crash ( / doc )
    (setq doc (vla-get-ActiveDocument (vlax-get-acad-object)))
    (while T
    (vla-StartUndoMark doc)
    (command "line" pause pause "")
    (vla-EndUndoMark doc)
    )
    )

    Draw four lines. Cancel to end. Undo a few times. CRASH with the error I mentioned,
    or something similar.

    Obviously an error handler which contains (vla-EndUndoMark doc) will avoid the
    problem.

    Joe Burke
     
    Joe Burke, Feb 25, 2005
    #8
  9. James Maeding

    Joe Burke Guest

    James,

    I think you're right. What I posted above does not crash 2002 after multiple undos.

    Joe Burke
     
    Joe Burke, Feb 25, 2005
    #9
  10. The error I get is Fatal error: UNDOCMD 2.

    There's obviously major problems there.
     
    Tony Tanzillo, Feb 25, 2005
    #10
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.