Revert back to current layer

Discussion in 'AutoCAD' started by mmo, Aug 13, 2003.

  1. mmo

    mmo Guest

    Hello delboy,

    (I had to start a new thread to allow inclusion of the lisp example)

    Annother approach is to build the command into a lisp routine iand use "getvar" to check system variable "CMDACTIVE" to see if the command input has been completed, before you restore the layer. I use this technic often to resolve problems caused by variable input lengths because of the different paths that user can choose. See attached lisp for an example that is able to handle a relatively general set of commands.

    Note however, there are some exceptions to the general useability. With LEADER and QLEADER for instance, I've found that the "cmdactive" system variable seems to handle the "place leader arrow"-part and the "input mtext"-part as two seperate commands. I've ended up expanding the attached example into very elaborate shell around several exception commands (such as LEADER, QLEADER, MTEXT), emulating all the different possible input paths a user can choose. Because this is very "Corporate Layout" specific, I leave it up to the reader to customise the given example according to their specific needs.

    My example routine is also not yet protected against a user aborting the command. Please feel free to incorporate your own error routine to catch this event, to get the previous layer restored in case of an abort also.

    With friendly greetings, M. Moolhuysen.
     
    mmo, Aug 13, 2003
    #1
  2. mmo

    dellboy Guest

    Thanks a lot for the code, I will be putting it to work shortly, though I can't write any error trapping, just not good enough
    Derek Mitchell
     
    dellboy, Aug 14, 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.