Results 1 to 5 of 5

Thread: Mtext in LISP

  1. #1
    Member
    Join Date
    2007-03
    Posts
    32
    Login to Give a bone
    0

    Default Mtext in LISP

    I have a routine that runs a leader with mtext as the note and places the note on a special text layer. At the end of the routine, like many of my office's routines, the layer and other variables are set back to what they were before the lisp routine. I'm having a problem though, after the mtext is ran I get an error message and the routine is ended after the mtext is place, therefor leaving me on the text layer rather than the original layer. The note is place properly and on the right text layer, but the routine does not finish. Is there something odd about mtext in a lisp routine that I'm missing? Is there a special wawy to invoke mtext in a lisp? Thank you for any help.

  2. #2
    Active Member
    Join Date
    2008-08
    Posts
    55
    Login to Give a bone
    0

    Default Re: Mtext in LISP

    if you don't know how to use the Vlisp IDE to track down the error I would suggest doing a search on Error handling and just plan for the error to take place. I sometimes design routines to use error handling as it's "finalize/clean up" statement. Meaning I'll cause an error to make sure it hits. In that error handler I restore any variables that need be returned to their previous state, and restore the error handler back to the way I found it.

    Mostly I would suggest doing a search for the visual lisp developers bible... That way you can cure the problem instead of the symptom. I know I've run into it on multiple occasions looking for other things anyway.
    Last edited by howardjosh; 2009-04-17 at 10:51 PM.

  3. #3
    Certifiable AUGI Addict
    Join Date
    2015-11
    Location
    Jo'burg SA
    Posts
    4,512
    Login to Give a bone
    0

    Default Re: Mtext in LISP

    Are you using (command "mtext" ....) to make the mtext, entmake, or vla-Add? In any one of these, it's good practice have some form of error handling which reverts any settings (such as CLAYER) back to orriginal. howardjosh is correct about that This forum has several examples of error handling, just do a search.

    As to actually fixing the problem, howardjoshtook the words from my mouth again

    I use the VLIDE's watch & step debugging, to see exactly what happened. But even if you find & correct the error, still look at error handling ... what happens if the user presses ESC instead of enter (or some Exit option) when stopping your routine?

  4. #4
    The Silent Type RobertB's Avatar
    Join Date
    2000-01
    Location
    Seattle WA USA
    Posts
    5,859
    Login to Give a bone
    0

    Lightbulb Re: Mtext in LISP

    Quote Originally Posted by ticad02 View Post
    Is there a special [way] to invoke mtext in a lisp?
    If you are using a pause in the MText command, you need to switch the TextEval system variable to 1.
    R. Robert Bell
    Design Technology Manager
    Stantec
    Opinions expressed are mine alone and do not reflect the views of Stantec.

  5. #5
    Member
    Join Date
    2007-03
    Posts
    32
    Login to Give a bone
    0

    Default Re: Mtext in LISP

    Thanks all. I'm looking into these options and hopefully will find an answer.

Similar Threads

  1. Move MText at a certain Z value LISP
    By djin_fre3449006 in forum AutoLISP
    Replies: 5
    Last Post: 2013-11-28, 08:17 AM
  2. MText Size Lisp
    By dmedeiros342558 in forum AutoLISP
    Replies: 2
    Last Post: 2013-02-05, 10:14 PM
  3. Lisp and Annotative MTEXT
    By bowtle in forum AutoLISP
    Replies: 1
    Last Post: 2010-02-20, 06:01 PM
  4. Mtext Command in Lisp
    By bowtle in forum AutoLISP
    Replies: 12
    Last Post: 2009-01-12, 05:47 PM
  5. Create MTEXT with Lisp
    By jjacoby in forum AutoLISP
    Replies: 1
    Last Post: 2005-11-09, 02:33 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •