Results 1 to 3 of 3

Thread: Error Handling

  1. #1
    Member
    Join Date
    2002-01
    Posts
    2
    Login to Give a bone
    0

    Default Error Handling

    I'm looking for a some error handling. With a little luck and a lot of help from other peoples posts I got my list routine to work. Now that it's working I would like to add some error handling on not allowing xrefs to attach more that once. They attach fine but if I accidently attach one again it errors out. If any one could help that would be greatly appreciated. See attachment for the code...Thanks
    Attached Files Attached Files

  2. #2
    I could stop if I wanted to
    Join Date
    2003-11
    Posts
    277
    Login to Give a bone
    0

    Default Re: Error Handling

    Hi whattaz,
    Do you mean error handling code like this
    Code:
    (defun c:test (/ *error* om otm opt)
      (setq *error* myer)
      (setq om (getvar "xxx"))  
      (setvar "xxx" 0)
      (setq otm (getvar "yyy"))
      (setvar "yyy" 1)
    
      (setq opt (getstring t "\nPress Esc button to test error: "))
      ;*****PUT YOUR MAIN CODE HERE *******
      
      (setvar "xxx" om)
      (setvar "yyy" otm)
      (setq *error* nil)
      (princ)
      )
    
    (defun myer (msg)
      (setvar "xxx" om)
      (setvar "yyy" otm)
      (setq att "*** Resetting system variable has been done ***")
      (princ att)
      )
    Quote Originally Posted by whattaz13 View Post
    I'm looking for a some error handling. With a little luck and a lot of help from other peoples posts I got my list routine to work. Now that it's working I would like to add some error handling on not allowing xrefs to attach more that once. They attach fine but if I accidently attach one again it errors out. If any one could help that would be greatly appreciated. See attachment for the code...Thanks

  3. #3
    Member
    Join Date
    2002-01
    Posts
    2
    Login to Give a bone
    0

    Default Re: Error Handling

    Thanks Adesu, I might not fully understand you code. But I don't think that's it. If you look at my lsp code under the refnew command for example. That's where my error happens when I'm renaming the xref. I would like to detach the duplicated xref and then continue w/ the code.
    Last edited by whattaz13; 2008-07-16 at 04:06 PM.

Similar Threads

  1. Error Handling
    By ticad02 in forum AutoLISP
    Replies: 16
    Last Post: 2009-12-21, 03:39 PM
  2. Error Handling
    By jwf in forum AutoCAD Customization
    Replies: 2
    Last Post: 2004-12-03, 07:42 PM
  3. VBA Error Handling
    By msretenovic in forum ATP Course Wishlist
    Replies: 0
    Last Post: 2004-09-17, 07:58 PM
  4. Error Handling:
    By spencer.67965 in forum AutoLISP
    Replies: 4
    Last Post: 2004-09-15, 09:18 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
  •