andy_lee Posted August 22, 2014 Share 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 Link to comment Share on other sites More sharing options...
marko_ribar Posted August 22, 2014 Share Posted August 22, 2014 (defun c:foo ( / vars... ) (command "_.ucs" "_w") ... (etc...) ... (command "_.ucs" "_p") (princ) ) Quote Link to comment Share on other sites More sharing options...
andy_lee Posted August 22, 2014 Author Share 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 Link to comment Share on other sites More sharing options...
Lee Mac Posted August 22, 2014 Share 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 Link to comment Share on other sites More sharing options...
andy_lee Posted August 23, 2014 Author Share Posted August 23, 2014 Add: Thanks Lee. I know , I can't open that link, is this ? http://lee-mac.com/errorhandling.html Quote Link to comment Share on other sites More sharing options...
Dana W Posted August 23, 2014 Share 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 Link to comment Share on other sites More sharing options...
andy_lee Posted August 23, 2014 Author Share 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 Link to comment Share on other sites More sharing options...
marko_ribar Posted August 23, 2014 Share 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 Link to comment Share on other sites More sharing options...
andy_lee Posted August 24, 2014 Author Share Posted August 24, 2014 Thanks! marko. Quote Link to comment Share on other sites More sharing options...
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.