Results 1 to 6 of 6

Thread: *error*

  1. #1
    I could stop if I wanted to
    Join Date
    2006-04
    Posts
    466
    Login to Give a bone
    0

    Default *error*

    how should i feel about loading *error* as a routine? is it a violation?
    Code:
    (DEFUN *error* (MSG)
    
    (vl-load-com)
    
     (PROGN
     ; (vl-cmdf  "_UCS" "D" "WATUCS")
     ; (vl-cmdf  "_UCS" "S" "WATUCS")
     ; (IF (/= (TBLSEARCH "UCS" "OUCS") NIL) (vl-cmdf  "_UCS" "R" "OUCS"))
      (IF (/= FILP NIL) (SETVAR "CMDECHO" FILP))
    
    (IF (/= INSU NIL) (SETVAR "INSUNITS" INSU))
    
    (IF (/= INSUDF NIL) (SETVAR "INSUNITSDEFSOURCE" INSUDF))
    
    (IF (/= INSUDT NIL) (SETVAR "INSUNITSDEFTARGET" INSUDT))
    
    
    
    ;  (PRINC "error: ")
    ;  (PRINC MSG)
      (PRINC) 
    ));END PROGN/DEFUN
    Last edited by BlackBox; 2021-08-03 at 05:07 PM. Reason: Please use [CODE] Tags

  2. #2
    Certifiable AUGI Addict
    Join Date
    2001-03
    Location
    Tallahassee, FL USA
    Posts
    3,667
    Login to Give a bone
    0

    Default Re: *error*

    That could affect every other lisp run afterwards in that drawing session.
    You can include *error* as a local variable and define a local *error* function inside your lisp like many of us programers do.

    Well described example: http://www.lee-mac.com/errorhandling.html
    Last edited by Tom Beauford; 2021-08-03 at 05:28 PM. Reason: added link to example by Lee Mac

  3. #3
    I could stop if I wanted to
    Join Date
    2006-04
    Posts
    466
    Login to Give a bone
    0

    Default Re: *error*

    thanks Tom!!

  4. #4
    I could stop if I wanted to
    Join Date
    2006-04
    Posts
    466
    Login to Give a bone
    0

    Default Re: *error*

    Is there a way to restore a UCS without calls to command or vl-cmdf, so I can use it in *error* ?

    i tried:

    (IF (/= (TBLSEARCH "UCS" "OUCS") NIL) (SETVAR "UCSBASE" "OUCS"))

    didn't work
    Last edited by aaronic_abacus; 2021-08-05 at 07:05 PM.

  5. #5
    Member
    Join Date
    2001-03
    Location
    ROMANIA
    Posts
    35
    Login to Give a bone
    0

    Default Re: *error*

    Quote Originally Posted by aaronic_abacus View Post
    Is there a way to restore a UCS without calls to command or vl-cmdf, so I can use it in *error* ?

    i tried:

    (IF (/= (TBLSEARCH "UCS" "OUCS") NIL) (SETVAR "UCSBASE" "OUCS"))

    didn't work
    Try the function vla-sendcommand

  6. #6
    I could stop if I wanted to
    Join Date
    2006-04
    Posts
    466
    Login to Give a bone
    0

    Default Re: *error*

    thanks Lido! now i can call from the *error* file!!! and locally tom

    Code:
    (DEFUN *error* (MSG)
    
      (vl-load-com)
    
      (PROGN
      ; (vl-cmdf  "_UCS" "D" "WATUCS")
      ; (vl-cmdf  "_UCS" "S" "WATUCS")
      ; (IF (/= (TBLSEARCH "UCS" "OUCS") NIL) (vl-cmdf  "_UCS" "R" "OUCS"))
    
    
      (IF (/= (TBLSEARCH "UCS" "OUCS") NIL)
       (PROGN
    
        (setq thisdrawing ( vla-get-activedocument(vlax-get-acad-object))) 
        (vla-SendCommand thisdrawing (strcat "_UCS" " " "NA" " " "R" " " "OUCS" "\n")) 
    
      ));END PROGN/IF
      (princ)
    
      (IF (/= FILP NIL) (SETVAR "CMDECHO" FILP))
    
      (IF (/= INSU NIL) (SETVAR "INSUNITS" INSU))
    
      (IF (/= INSUDF NIL) (SETVAR "INSUNITSDEFSOURCE" INSUDF))
    
      (IF (/= INSUDT NIL) (SETVAR "INSUNITSDEFTARGET" INSUDT))
    
    ;  (PRINC "error: ")
    ;  (PRINC MSG)
      (PRINC) 
     ));END PROGN/DEFUN

Similar Threads

  1. solprof error in xp pro sp1/ no error in windows 2000
    By Anthony.Bates in forum AutoCAD 3D (2006 or below)
    Replies: 1
    Last Post: 2005-04-05, 10:00 AM
  2. Acad 2005 error - ERROR in endWblock:eInvalidInput
    By matthewmiller in forum AutoCAD General
    Replies: 1
    Last Post: 2005-03-05, 02:12 PM
  3. ; error: no function definition: ACET-ERROR-INIT
    By gab.83408 in forum AutoCAD Customization
    Replies: 1
    Last Post: 2005-03-01, 12:19 AM
  4. Replies: 8
    Last Post: 2005-02-14, 11:41 PM
  5. Fatal Error: Unhandled Exception" Error Message
    By jkrulicki in forum MDT - General
    Replies: 2
    Last Post: 2004-07-28, 03:56 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
  •