LtScale control

Discussion in 'AutoCAD' started by F. Gump, Jun 1, 2004.

  1. F. Gump

    F. Gump Guest

    Is there a program like ltscale_switch that is free, with nag screens?
    I would buy the thing, but they haven't responded to my emails.
    Anyway, it seems like a simple task, to switch to a preset ltscale in
    paperspace. Anyonw have an alternate?
     
    F. Gump, Jun 1, 2004
    #1
  2. F. Gump

    ECCAD Guest

    You mean something like this ?

    ;LtScale Switch..
    ;www.bobscadshop.com
    ;
    (defun C:LT+ ()
    (setq lts (getvar "LTSCALE"))
    (setq lts (+ lts 1.0))
    (command "_LTSCALE" lts)
    (princ)
    ); end function LT+
    (defun C:LT- ()
    (setq lts (getvar "LTSCALE"))
    (if (> lts 1.0)
    (progn
    (setq lts (- lts 1.0))
    (command "_LTSCALE" lts)
    ); end progn
    ); end if
    (princ)
    ); end function

    Bob
     
    ECCAD, Jun 1, 2004
    #2
  3. F. Gump

    ECCAD Guest

    Or, for presets..

    ; LtScale Switch..with presets..
    (defun C:SLT ( lts preset1 preset2 flag )
    (setq preset1 5.0)
    (setq preset2 3.0)
    ;
    (setq flag 0)
    (setq lts (getvar "LTSCALE"))
    ;
    (if (and (/= lts preset1)(/= lts preset2))
    (progn
    (command "_LTSCALE" preset1)
    (setq flag 1)
    ); end progn
    ); end if
    (if (and (= flag 0)(= lts preset1))
    (progn
    (command "_LTSCALE" preset2)
    (setq flag 1)
    ); end progn
    ); end if
    (if (and (= flag 0)(= lts preset2))
    (command "_LTSCALE" preset1)
    ); end if
    (princ)
    ); end function

    Bob
     
    ECCAD, Jun 1, 2004
    #3
  4. F. Gump

    OLD-CADaver Guest

    We use a reactor for LAYOUT/MODEL tabs. IF you switch to a layout tab it presets LTSCALE to 0.375 and PSLTSCALE to 1. If you switch to the model tab it sets ltscale to 40.
     
    OLD-CADaver, Jun 1, 2004
    #4
  5. F. Gump

    ECCAD Guest

    You want to post the code ?

    Bob
     
    ECCAD, Jun 1, 2004
    #5
  6. F. Gump

    F. Gump Guest

    I'm looking for something that reacts to the actual switching of MS and PS.
     
    F. Gump, Jun 1, 2004
    #6
  7. F. Gump

    F. Gump Guest

    I like the reactor idea (which is what I need) but is there a way to make
    the model LTS dynamic? I don't always want it 40 (or any preset value).
    I want it to remember what lts I last used in model space, and reset it.

    presets LTSCALE to 0.375 and PSLTSCALE to 1. If you switch to the model tab
    it sets ltscale to 40.
     
    F. Gump, Jun 1, 2004
    #7
  8. F. Gump

    OLD-CADaver Guest

    <<You want to post the code ?>>

    It's been posted here several times in the past

    Try:

    http://tinyurl.com/342mk

    Then edit as required.
     
    OLD-CADaver, Jun 1, 2004
    #8
  9. F. Gump

    OLD-CADaver Guest

    See the attached thread above for basic code.

    Then you can modify it to read the current DIMSCALE and multiply that by a factor. Or set a variable for recall later.
     
    OLD-CADaver, Jun 1, 2004
    #9
  10. F. Gump

    Jamie Duncan Guest

    Run withthis Forrest. run with this....

    (defun ChangedLayout (reactor layout / )
    (if (= (nth 0 layout) "Model")(setvar "ltscale" (* (if (= (getvar
    "dimscale") 0) 1 (getvar "dimscale")) YOURFACTORHERE))(progn (setvar
    "ltscale" YOURFACTORHERE) (setvar "psltscale" 1)))
    )
    (if(not *LayoutLTS*) (setq *LayoutLTS* (VLR-Miscellaneous-Reactor nil
    '(:)VLR-layoutSwitched . ChangedLayout)))))

    Jamie Duncan
     
    Jamie Duncan, Jun 1, 2004
    #10
  11. F. Gump

    F. Gump Guest

    Now we're talking!
    thanks alot. Did you write this code?
     
    F. Gump, Jun 1, 2004
    #11
  12. F. Gump

    GaryDF Guest

    Another Option:

    Here is how I changed the ltscale for each of the layouts listed below using
    this reactor.
    layout = "Fullsize", "HalfSize" and "DWF"....I need a different ltscale
    factor for each layout.

    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;;;;;;;
    ;;;;;;;;;;;;;;;;;;;;;;;;; Ltscale and Psltscale Reactor
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;;;;;;;
    (defun ARCH:ChangedLayout (reactor layout /)
    (setq layout
    (cdr
    (cons 410 (vla-get-name
    (vla-get-activelayout
    (vla-get-activedocument
    (vlax-get-acad-object))))
    )
    )
    )
    (cond
    ((= layout "FullSize")
    (progn (setvar "ltscale" (abs (/ (getvar "dimscale") 2))))
    (progn (setvar "ltscale" (/ (getvar "dimscale") 2))(setvar "psltscale"
    0))
    )
    ((= layout "HalfSize")
    (progn (setvar "ltscale" (abs (/ (getvar "dimscale") 2))))
    (progn (setvar "ltscale" 2)(setvar "psltscale" 0))
    )
    ((= layout "DWF")
    (progn (setvar "ltscale" (abs (/ (getvar "dimscale") 2))))
    (progn (setvar "ltscale" 2)(setvar "psltscale" 0))
    )
    )
    ;;(C:MODE) ;modemacro function
    )

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

    Gary
     
    GaryDF, Jun 1, 2004
    #12
  13. F. Gump

    OLD-CADaver Guest

    First time I saw it (2001), it was posted by Jason Piercey, and I think he got it from Rob Starz.

    Remember you have to run (vl-load-com) for it to work.
     
    OLD-CADaver, Jun 1, 2004
    #13
  14. F. Gump

    Jamie Duncan Guest

    It's a slightly modified version of an R. Robert Bell effort.


    and you're very welcome!

    Jamie Duncan
     
    Jamie Duncan, Jun 1, 2004
    #14
  15. F. Gump

    OLD-CADaver Guest

    I should have guessed the Mr Bell had a hand in it somewhere along the line.
     
    OLD-CADaver, Jun 2, 2004
    #15
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.