Jump to content

timmee2891

Recommended Posts

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?

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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)

Link to comment
Share on other sites

(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]

Link to comment
Share on other sites

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...

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

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...