Jump to content

Help with error trapping and exploding block.


Jimmy Sean

Recommended Posts

If I take out the * that preceedes the block name the error trapping works as expected but when it is in the code "*PLOTSTAMP-B" the error trapping does not work. Can anyone explain why?

 

 

;; Error handling function
(defun MyExit (msg)
 (cond
   ((not msg))    ; no error, normal exit
   ((member msg '("Function cancelled" "quit / exit abort"))) ; <esc> or (quit)
   ((princ (strcat "\nError: " msg)))
   )     ; End Cond
 (COMMAND ".UNDO" "b") ;| any other code for needed cleanup |;
 (princ)
)
;; Program Code
(defun C:XREFBORDERANDPLOTSTAMP (/ *ERROR*)
 (SETQ *ERROR* MyExit)
 (COMMAND ".UNDO" "M")
 (command "fielddisplay" "0")
 (command "tilemode" "0")
 (command
   "_.-xref"
   "_o"
   (getfiled "Select Drawing to Xref"
      (strcat (vl-filename-directory
  (vl-filename-directory (getvar "DwgPrefix"))
       )
       "\\"
      )
      "dwg"
      2
   )
   "0,0,0"
   ""
   ""
   ""
 )     ;CLOSE XREF
 (command ".zoom" "w" "-1,-1" "4,7");zooms to the lower left corner of the border
 (alert "Please select the insertion point for the Plot Stamp.\n(Off of Lower left corner of the Border not the trim border.)"
 )
 (command "-layer" "N" "HAI_PLOTSTAMP" "S" "HAI_PLOTSTAMP" ""); creates and sets the HAI-PLOTSTAMP layer
 (command "-INSERT" "*PLOTSTAMP-B" pause "" "");inserts the plot stamp
 (command ".zoom" "e")
)

 

Thanks,

Sean

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...