LTscale Change Via Reactor.... ?

Discussion in 'AutoCAD' started by Bratz2, Sep 12, 2003.

  1. Bratz2

    Bratz2 Guest

    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?
     
    Bratz2, Sep 12, 2003
    #1
  2. Bratz2

    Warren Trost Guest

    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 in message news:...

    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?
     
    Warren Trost, Sep 12, 2003
    #2
  3. Bratz2

    Bratz2 Guest

    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.
     
    Bratz2, Sep 12, 2003
    #3
  4. Bratz2

    Bratz2 Guest

    Thank you. I took a few minutes out, and got it to switch between MS/PS with constant values, thanks for all the help
     
    Bratz2, Sep 12, 2003
    #4
  5. Bratz2

    jclaidler Guest

    The only problem with this code, is what happens when dimscale is 0 in PS ??
     
    jclaidler, Sep 15, 2003
    #5
  6. Bratz2

    Warren Trost Guest

    I don't use "0" so I don't know.  I only modified the code that was posted here earlier.



    "jclaidler" <-usa.com> wrote in message news:...

    The only problem with this code, is what happens when dimscale is 0 in PS ??
     
    Warren Trost, Sep 15, 2003
    #6
  7. Bratz2

    Bratz2 Guest

    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...
     
    Bratz2, Sep 16, 2003
    #7
  8. Bratz2

    Bratz2 Guest

    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.
     
    Bratz2, Sep 16, 2003
    #8
  9. Bratz2

    jclaidler Guest

    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))))
    )
    ;;;
    ;;;
     
    jclaidler, Sep 16, 2003
    #9
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.