timmee2891 Posted November 25, 2014 Posted November 25, 2014 Sorry if this thread has been posted before. Is it possible to have a lisp that when using “TM” in model space it changes to paper space and adjusts the Dimscale to 1 and Ltscale to 10. Then when using “TM” again it changes to model space but uses the same dimscale and ltscale that it was set at before changing to paper space? Quote
hanhphuc Posted November 25, 2014 Posted November 25, 2014 hi timmee, welcome to the forum Sorry if this thread has been posted before. Is it possible to have a lisp that when using “TM” in model space it changes to paper space and adjusts the Dimscale to 1 and Ltscale to 10. Then when using “TM” again it changes to model space but uses the same dimscale and ltscale that it was set at before changing to paper space? (defun c:tm (/ var )(terpri) (setq var '(tilemode dimscale ltscale)) ;_ end of setq (or *tilemode_var* (setq *tilemode_var* (mapcar 'getvar var))) (if (zerop (getvar 'tilemode) ) (mapcar 'setvar var (cons 1 (cdr *tilemode_var*))) (mapcar 'setvar var '(0 1.0 10.0)) ) ;_ end of if ) ;_ end of defun HTH? Quote
BIGAL Posted November 25, 2014 Posted November 25, 2014 TM is already set to normal Tilemode command maybe use C:TZ Quote
timmee2891 Posted November 25, 2014 Author Posted November 25, 2014 Hi, thanks. it works for getting to Paperspace and setting the correct Dimscale and LTscale but it doesnt revert back to the ltscale and dimscale that was used in modelspace. eg. in modelspace ltscale = 0.02, dimscale = 0.002 use tm paperspace ltscale = 10, dimscale = 1 use tm modelspace ltscale = 100, dimscale = 10 (i need this line to match the original modelspace of 0.02 and 0.002 or whatever else the values may be) Quote
hanhphuc Posted November 25, 2014 Posted November 25, 2014 (i need this line to match the original modelspace of 0.02 and 0.002 or whatever else the values may be) you can try putting this global variable as default before defun (setq *tilemode_var* (mapcar 'setvar '(dimscale ltscale) '(0.002 0.02 ))) [color="gray"](defun c:tm (/ var ) ... ... ...)[/color] Quote
timmee2891 Posted November 25, 2014 Author Posted November 25, 2014 that's only assuming the scale is 1:2m (dim = 0.002, lt = 0.02) i need it to analyse what the last known scale used in modelspace was and then adjust to suit... Quote
hanhphuc Posted November 25, 2014 Posted November 25, 2014 that's only assuming the scale is 1:2m (dim = 0.002, lt = 0.02) i need it to analyse what the last known scale used in modelspace was and then adjust to suit... we don't change any existing variable in modelspace (defun c:tm (/ var )(terpri) ... ... (or *tilemode_var* (setq [color="red"]*tilemode_var*[/color] (mapcar '[color="navy"]getvar[/color] var))) ... ... ...) look in the code *tilemode_var* the variable is set to global if invoke c:tm, known dimscale & ltscale are stored as a list command: !*tilemode_var* ;returns: '(1 0.02 10.0) ;ie: tilemode=1 , dimscale=0.02 , ltscale=10.0 (setq *tilemode_var* [color="blue"]nil[/color]) ; to initialize Quote
BlackBox Posted November 25, 2014 Posted November 25, 2014 that's only assuming the scale is 1:2m (dim = 0.002, lt = 0.02) i need it to analyse what the last known scale used in modelspace was and then adjust to suit... You'll need to get either the Standard Scale, or Annotation Scale of the activated Viewport. If you're not already, I'd highly recommend that you consider using Annotative Scales; makes life so much easier. 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.