Author Topic: Need a little help  (Read 3289 times)

0 Members and 1 Guest are viewing this topic.

Kate M

  • Guest
Need a little help
« on: May 06, 2004, 11:10:54 AM »
I got this reactor off the Autodesk groups -- how do I change it to have the modelspace ltscale be equal to 1/2 the dimscale? I tried all sorts of combinations, but couldn't get it to work...the poor formatting isn't helping either.

Code: [Select]
(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)))))


Or, if you have a better way to do this, I'm open to suggestions. :-)

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
Need a little help
« Reply #1 on: May 06, 2004, 12:24:02 PM »
I believe this is correct !
Code: [Select]

(defun ChangedLayout (reactor layout /)
   (if (= (nth 0 layout) "Model")
(setvar "ltscale"
(* (if (= (getvar "dimscale") 0)
 1
 ; else
 (getvar "dimscale")
 ); if
0.5
); *
)
(progn (setvar "ltscale" 0.5)
(setvar "psltscale" 1)
)
); if
   )
TheSwamp.org  (serving the CAD community since 2003)

Kate M

  • Guest
Need a little help
« Reply #2 on: May 06, 2004, 01:06:44 PM »
I think I'm missing something -- how do I get it to run? I saved it as a lsp file and loaded it...

Kate M

  • Guest
Need a little help
« Reply #3 on: May 06, 2004, 01:28:29 PM »
Duh...nevermind...forgot my DIMSCALE was set to 1, and wondered why I didn't see any change...Thanks Mark!

Kate M

  • Guest
Need a little help
« Reply #4 on: May 07, 2004, 09:59:20 AM »
One more question -- is there a way to tack a REGENALL on to the end of it?

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
Need a little help
« Reply #5 on: May 07, 2004, 10:31:44 AM »
maybe like this
Code: [Select]

(defun   ChangedLayout (reactor layout /)
   (if (= (nth 0 layout) "Model")
    (setvar "ltscale"
          (*   (if   (= (getvar "dimscale") 0)
              1
              ; else
              (getvar "dimscale")
              ); if
            0.5
            ); *
          )
    (progn   (setvar "ltscale" 0.5)
         (setvar "psltscale" 1)
         )
    ); if
  (vla-regen
(vla-get-ActiveDocument
 (vlax-get-acad-object)
 )
acAllViewports
)
   )
TheSwamp.org  (serving the CAD community since 2003)