linetype scale toggle..

Discussion in 'AutoCAD' started by Jon Baker, Jun 11, 2004.

  1. Jon Baker

    Jon Baker Guest

    I hope you don't think I am spamming..

    have a list of questions..

    this is supposed to switch the LTS when toggling back and forth from PS to MS by using the dimscale SYS VAR (adding it to the acad2000doc.lsp).. well it does not work. any ideas?
    (defun ChangedLayout (reactor layout / )
    (if (= (nth 0 layout) "Model")(setvar "ltscale" (getvar "dimscale"))(prong (setvar "ltscale" ) (setvar "psltscale" 1)))
    )
    (if (not *LayoutLTS*) (setq *LayoutLTS* (VLR-Miscellaneous-Reactor nil '(:)VLR-layoutSwitched . ChangedLayout)))))
     
    Jon Baker, Jun 11, 2004
    #1
  2. Jon Baker

    Jon Baker Guest

    okay it seems that 2.5 years ago i asked these last two questions.. lol..
    anyways.. so umm where can i get this vla-support lisp from?

    ;====== begin
    (load "vla-support.lsp")

    (defun R:ChangedTab (reactor layout)
    (if [LR:ignore]
    (princ "\nLayout reactor ignored")
    (if (= (nth 0 layout) "Model")
    (vla-setvariable (active-document) "LTSCALE" (vla-getvariable (active-document) "DIMSCALE"))
    (progn
    (vla-setvariable (active-document) "LTSCALE" 1)
    (vla-setvariable (active-document) "PSLTSCALE" 1)
    )
    )
    )
    )
    (cond ((not *LayoutLtscale*)
    (setq *LayoutLtscale* (VLR-Miscellaneous-Reactor nil '(:)VLR-layoutSwitched . R:ChangedTab))))
    (prompt "\nLayout reactor for linetype scaling is ON")
    )
    (T ;; *LayoutLtscale* is set
    (prompt "\nLayout reactor for linetype scaling is ON")
    )


    ;=== for text size (begin)
    (setq mdsc (/ (getvar "dimscale") 10))
    (if [LR:ignore]
    (princ "\nLayout reactor ignored")
    (if (= (nth 0 layout) "Model")
    (vla-setvariable (active-document) "TEXTSIZE" mdsc )
    (progn
    (vla-setvariable (active-document) "TEXTSIZE" 0.1)
    )
    )
    )
    )
    (cond ((not *LayoutLtscale*)
    (setq *LayoutLtscale* (VLR-Miscellaneous-Reactor nil '(:)VLR-layoutSwitched . R:ChangedTab))))
    )
    (T ;; *LayoutLtscale* is set
    (prompt "\nLayout reactor for text size is ON")
    )
    ;=== for text size (end)

    )
    (setq [LR:ignore] nil) ;; use reactor by default
    (princ)

    ;===== end
     
    Jon Baker, Jun 11, 2004
    #2
  3. Jon Baker

    zeha Guest

    ;;Maybe only missing
    ;;(vl-load-com)
    ;;(setq activeDocument (vla-get-activedocument (vlax-get-acad-object)))

    ;;Try it with this modified version

    ;====== begin

    (defun R:ChangedTab (reactor layout)
    (vl-load-com)
    (setq activeDocument (vla-get-activedocument (vlax-get-acad-object)))
    (if [LR:ignore]
    (princ "\nLayout reactor ignored")
    (if (= (nth 0 layout) "Model")
    (vla-setvariable activeDocument "LTSCALE" (vla-getvariable activeDocument "DIMSCALE"))
    (progn
    (vla-setvariable activeDocument "LTSCALE" 1)
    (vla-setvariable activeDocument "PSLTSCALE" 1)
    )
    )
    )
    )
    (cond ((not *LayoutLtscale*)
    (setq *LayoutLtscale* (VLR-Miscellaneous-Reactor nil '(:)VLR-layoutSwitched . R:ChangedTab))))
    (prompt "\nLayout reactor for linetype scaling is ON")
    )
    (T ;; *LayoutLtscale* is set
    (prompt "\nLayout reactor for linetype scaling is ON")
    )


    ;=== for text size (begin)
    (setq mdsc (/ (getvar "dimscale") 10))
    (if [LR:ignore]
    (princ "\nLayout reactor ignored")
    (if (= (nth 0 layout) "Model")
    (vla-setvariable activeDocument "TEXTSIZE" mdsc )
    (progn
    (vla-setvariable activeDocument "TEXTSIZE" 0.1)
    )
    )
    )
    )
    (cond ((not *LayoutLtscale*)
    (setq *LayoutLtscale* (VLR-Miscellaneous-Reactor nil '(:)VLR-layoutSwitched . R:ChangedTab))))
    )
    (T ;; *LayoutLtscale* is set
    (prompt "\nLayout reactor for text size is ON")
    )
    ;=== for text size (end)

    )
    (setq [LR:ignore] nil) ;; use reactor by default
    (princ)

    ;===== end
     
    zeha, Jun 11, 2004
    #3
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.