Jimmy Sean Posted March 2, 2011 Posted March 2, 2011 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 Quote
Recommended Posts
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.