LTscale Change Via Reactor.... ?

Bratz2

Usenet Archive
Joined
Jul 2, 2003
Messages
35
Reaction score
0
How can I get a reactor to trigger a setting such as LTscale when someone switches back, and forth from MS to PS via the "Layout Tabs", or by using tilemode?
 
Here is one way to do it.  This was posted here, author's name not remembered, with modifications to fit my needs.  I load it with my ACADDOC.LSP file.

 

;;  ChangedLayout.lsp
;;
;;  changes LTSCALE when switching MODEL/PAPER.

 

(defun ChangedLayout (reactor layout / )
  (if (= FACI "PAULENG")     ; SET DIMSCALE/LTSCALE = 1.0     (if (= (nth 0 layout) "Model")       (setvar "ltscale" (* (getvar "dimscale") 1.0 ))       (progn         (setvar "ltscale" 1.0)         (setvar "psltscale" 1)       )
    )

 

    (if (= (nth 0 layout) "Model") ; else set to 0.5       (setvar "ltscale" (* (getvar "dimscale") 0.5 ))       (progn         (setvar "ltscale" 0.5)         (setvar "psltscale" 1)       )     )   )
)

 

(if(not *LayoutLTS*)
  (setq *LayoutLTS* (VLR-Miscellaneous-Reactor nil '((:VLR-layoutSwitched . ChangedLayout))))
)

 

;;;  change 0.5 above to the scale factor you normally use

 

 

"Bratz2" <> wrote:

How can I get a reactor to trigger a setting such as LTscale when someone switches back, and forth from MS to PS via the "Layout Tabs", or by using tilemode?
 
Now, how would I change this to be a constant ltscale of 25 when in model space? The 0.5 is perfect, it's what he use in this office.
 
Thank you. I took a few minutes out, and got it to switch between MS/PS with constant values, thanks for all the help
 
The only problem with this code, is what happens when dimscale is 0 in PS ??
 
I don't use "0" so I don't know.  I only modified the code that was posted here earlier.

"jclaidler" <> wrote:

The only problem with this code, is what happens when dimscale is 0 in PS ??
 
I removed the dimscale. See the attached, don't know if it's dirty, or what but it seems to work fine for me. Any improvements would be a welcome...
 
The only thing about this is, when switching to PS from MS, you have the "appearance" that the LT is wrong but a quick regen, will change that. I tried messing with the "Cache Last Layout", Cache all Layouts", etc, but didn't seem to have any affect.
 
What's wrong with this:

;; ChangedLayout.lsp
;;
;; changes LTSCALE when switching MODEL/PAPER.

(defun ChangedLayout (reactor layout / )
  (if (= (nth 0 layout) "Model") ; else set to 0.5     (progn (setq Fac (/ 12 (* 12 (caddr (trans '(0 0 1) 2 3))))) (setvar "dimscale" Fac) (setvar "ltscale" (* (getvar "dimscale") 0.5 ))      )     (progn     (setvar "ltscale" 0.5)   )  )
)

(if(not *LayoutLTS*)
  (setq *LayoutLTS* (VLR-Miscellaneous-Reactor nil '((:VLR-layoutSwitched . ChangedLayout)))) ) ;;; ;;;
 

Latest threads

Back
Top