andy_lee Posted August 22, 2014 Posted August 22, 2014 Hi guys Some times, there are some lisp code can't run on "UCS Mode" ,Only On "WCS", How to do? I think, maybe add "restore to WCS" at the beginning . I need some code . help! Quote
marko_ribar Posted August 22, 2014 Posted August 22, 2014 (defun c:foo ( / vars... ) (command "_.ucs" "_w") ... (etc...) ... (command "_.ucs" "_p") (princ) ) Quote
andy_lee Posted August 22, 2014 Author Posted August 22, 2014 (defun c:foo ( / vars... ) (command "_.ucs" "_w") ... (etc...) ... (command "_.ucs" "_p") (princ) ) Marko.Thank you! When error ,how "(command "_.ucs" "_p")" ? Quote
Lee Mac Posted August 22, 2014 Posted August 22, 2014 Add: (command "_.ucs" "_p") To the *error* function (if present), else define your own local *error* function containing this expression. More information on how to define an *error* function can be found here. Quote
andy_lee Posted August 23, 2014 Author Posted August 23, 2014 Add: Thanks Lee. I know , I can't open that link, is this ? http://lee-mac.com/errorhandling.html Quote
Dana W Posted August 23, 2014 Posted August 23, 2014 Thanks Lee. I know , I can't open that link, is this ? http://lee-mac.com/errorhandling.html That is the link. Quote
andy_lee Posted August 23, 2014 Author Posted August 23, 2014 How add: (command "_.ucs" "_p") to this function ? (defun c:test ( / *error* osm ) (defun *error* ( msg ) (if osm (setvar 'osmode osm)) (if (not (member msg '("Function cancelled" "quit / exit abort"))) (princ (strcat "\nError: " msg)) ) (princ) ) (setq osm (getvar 'osmode)) (setvar 'osmode 0) (rtos (getreal "\nPress Esc to exit, press Enter to force an error ...")) (setvar 'osmode osm) (princ) ) Quote
marko_ribar Posted August 23, 2014 Posted August 23, 2014 (defun c:test ( / *error* osm ) (defun *error* ( msg ) (if osm (setvar 'osmode osm)) (if (= (getvar 'worlducs) 1) (command "_.ucs" "_p")) (if (not (member msg '("Function cancelled" "quit / exit abort"))) (princ (strcat "\nError: " msg)) ) (princ) ) (setq osm (getvar 'osmode)) (setvar 'osmode 0) (command "_.ucs" "_w") (rtos (getreal "\nPress Esc to exit, press Enter to force an error ...")) (*error* nil) (princ) ) 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.