Lost in LtScale

Discussion in 'AutoCAD' started by GaryDF, Jun 3, 2004.

  1. GaryDF

    GaryDF Guest

    I have a base drawing in model space at dimscale 96 and ltscale 48 that is
    xrefed into a plot titleblock sheet in model space with three different
    layouts:
    FullSize, HalfSize and DWF....viewports are used to diplay the xref base
    within each of the three layouts.

    The problem is that the ltscale only displays correctly in the first layout,
    in the
    other two the ltscale is wrong. In the past we only use the first layout,
    even
    though the other two were created by our sheet setup routine. Now we are
    starting to use the other layouts for plotting.

    In the past we set (setvar "psltscale" 0) and dimscale 96 and ltscale 48 for
    the base and for the plot titleblock sheet....to get the ltscale to plot
    correctly.

    My question is what is the best way to have the ltscale displayed correctly
    in
    each of the three layouts?
    #1. Set (setvar "psltscale" 0) or (setvar "psltscale" 1)?
    #2 Set dimscale 96 and ltscale 48 for each layout?
    #3 Or run a routine similar to the one below?


    Gary





    ;;ltscale code routine
    ;;original code I think from R. Robert Bell and Peter Jamtgaard...
    (defun ARCH:ChangedLayout (reactor layout / lay-out)
    (setq lay-out
    (cdr
    (cons 410
    (vla-get-name
    (vla-get-activelayout
    (vla-get-activedocument
    (vlax-get-acad-object)
    )
    )
    )
    )
    )
    )
    (cond
    ((= lay-out "FullSize")
    (setvar "ltscale" (/ (getvar "dimscale") 2))
    )
    ((= lay-out "HalfSize")
    (setvar "ltscale" (/ (getvar "dimscale") 2))
    )
    ((= lay-out "DWF")
    (setvar "ltscale" (/ (getvar "dimscale") 2))
    )
    )
    )


    ;;code below is part of startup
    (vl-load-com)
    (if (not *LayoutLTS*)
    (setq *LayoutLTS*
    (VLR-Miscellaneous-Reactor
    nil
    '(:)VLR-layoutSwitched . ARCH:ChangedLayout))
    )
    )
    )
     
    GaryDF, Jun 3, 2004
    #1
  2. The reactor looks a bit complex. Do you use different scale factors in the
    Layouts? Many of us use a scale factor of 1 for all layouts, and on layouts
    that are half-size only modify the LFac.

    That way, PSLTScale would=1 while in a layout, and LTScale would = 0.5. Back
    in the Model tab you need to change LTScale to equal DimScale*0.5.

    Also, why not just create named page setups for all three styles of layout,
    and only use one layout assigned to full-size. Then at plot time you can
    apply one of the other named page setups (half or dwf). This way you don't
    recreate the titleblock "wheel" for three layouts. (Unless, of course, you
    *need* different titleblocks and/or objects for the other two layouts).


    --
    R. Robert Bell


    I have a base drawing in model space at dimscale 96 and ltscale 48 that is
    xrefed into a plot titleblock sheet in model space with three different
    layouts:
    FullSize, HalfSize and DWF....viewports are used to diplay the xref base
    within each of the three layouts.

    The problem is that the ltscale only displays correctly in the first layout,
    in the
    other two the ltscale is wrong. In the past we only use the first layout,
    even
    though the other two were created by our sheet setup routine. Now we are
    starting to use the other layouts for plotting.

    In the past we set (setvar "psltscale" 0) and dimscale 96 and ltscale 48 for
    the base and for the plot titleblock sheet....to get the ltscale to plot
    correctly.

    My question is what is the best way to have the ltscale displayed correctly
    in
    each of the three layouts?
    #1. Set (setvar "psltscale" 0) or (setvar "psltscale" 1)?
    #2 Set dimscale 96 and ltscale 48 for each layout?
    #3 Or run a routine similar to the one below?


    Gary





    ;;ltscale code routine
    ;;original code I think from R. Robert Bell and Peter Jamtgaard...
    (defun ARCH:ChangedLayout (reactor layout / lay-out)
    (setq lay-out
    (cdr
    (cons 410
    (vla-get-name
    (vla-get-activelayout
    (vla-get-activedocument
    (vlax-get-acad-object)
    )
    )
    )
    )
    )
    )
    (cond
    ((= lay-out "FullSize")
    (setvar "ltscale" (/ (getvar "dimscale") 2))
    )
    ((= lay-out "HalfSize")
    (setvar "ltscale" (/ (getvar "dimscale") 2))
    )
    ((= lay-out "DWF")
    (setvar "ltscale" (/ (getvar "dimscale") 2))
    )
    )
    )


    ;;code below is part of startup
    (vl-load-com)
    (if (not *LayoutLTS*)
    (setq *LayoutLTS*
    (VLR-Miscellaneous-Reactor
    nil
    '(:)VLR-layoutSwitched . ARCH:ChangedLayout))
    )
    )
    )
     
    R. Robert Bell, Jun 3, 2004
    #2
  3. GaryDF

    GaryDF Guest

    Thanks Robert

    We are going to modify our setup routine, and only use one layout...
    plotting as you suggested with different pagesetups.

    What was really confusing me was the psltscale variable.
    And I still donot fully understand it. I need it in simple english.

    Gary
     
    GaryDF, Jun 3, 2004
    #3
  4. Ok, try this:

    LTScale is the scale factor applied to the *drawing*. Not ModelSpace, which
    is where some get confused.
    PSLTScale is a toggle:

    When set to 1, it tells AutoCAD to display linetypes visible from a layout
    at a consistent factor (LTScale). So regardless of the scale of the
    viewports, and including the objects drawn in the layout itself, they all
    display consistently. (Let's *not* talk about LTScale-by-object!) However,
    in most cases people have a layout's scale factor (the plot scale) set to 1.
    So the LTScale needs to be set to a related small value, such as 0.5 (which
    is DimScale * 0.5).

    When set to 0, the linetypes display dashes based on the viewport's scale,
    which in many cases means that the dashes do not display as they are too
    small for a 1:1 plot.

    Here comes the tricky part:
    If you use PSLTScale=1, the LTScale needs to be 0.5 in the layout. But when
    you go back to ModelSpace, 0.5 is far too small in most cases for the
    dashing to display. So if ModelSpace is at a scale factor of, say, 96 (1/8"
    = 1'-0") then the LTScale needs to be 48 (96*0.5) in order for the user to
    see the dashes.

    So the reactor simply toggles the LTScale when you switch tabs. That being
    said, your reactor's function is too complex. Give this a shot:

    (defun ARCH:ChangedLayout (reactor layout)
    (setvar "LTScale"
    (* 0.5
    (cond ((/= (strcase (car layout)) "MODEL") 1)
    ((getvar "DimScale"))))))



    --
    R. Robert Bell


    Thanks Robert

    We are going to modify our setup routine, and only use one layout...
    plotting as you suggested with different pagesetups.

    What was really confusing me was the psltscale variable.
    And I still donot fully understand it. I need it in simple english.

    Gary
     
    R. Robert Bell, Jun 3, 2004
    #4
  5. GaryDF

    GaryDF Guest

    Thanks again...the light bulb over my head is getting brighter...

    I tried your routine...works great, but here is where I am still confused.

    The base drawing is set to dimscale 96 and ltscale 48. This drawing is
    xrefed
    into is the sheet "plot" drawing which also contains the xrefed titleblock
    sheet,
    this "plot" sheet is set to ltscale 1, so when I toggle from the layout to
    the
    model space the lineypes still donot show up correctly in model, only in
    paper space view port do they display correctly.

    This is not a problem, since I plot from paper space...where I am confused
    is
    why bother with a reactor for model space? If I set the dimscale to 96 and
    the ltscale to 48, then it does not display the linetypes correctly in the
    paper space
    view port....or is the light bulb getting dimmer?

    Gary
     
    GaryDF, Jun 3, 2004
    #5
  6. That reactor I posted works both ways, not just for going into Model Space.

    In your parent drawing, where the base drawing was xrefed into, model space
    should still be a DimScale of 96, since the original was 96 (unless you
    scaled the xref down???).

    Also, the reactor does not force a regen, so to see the effects, you might
    want to do a regenall.

    --
    R. Robert Bell


    Thanks again...the light bulb over my head is getting brighter...

    I tried your routine...works great, but here is where I am still confused.

    The base drawing is set to dimscale 96 and ltscale 48. This drawing is
    xrefed
    into is the sheet "plot" drawing which also contains the xrefed titleblock
    sheet,
    this "plot" sheet is set to ltscale 1, so when I toggle from the layout to
    the
    model space the lineypes still donot show up correctly in model, only in
    paper space view port do they display correctly.

    This is not a problem, since I plot from paper space...where I am confused
    is
    why bother with a reactor for model space? If I set the dimscale to 96 and
    the ltscale to 48, then it does not display the linetypes correctly in the
    paper space
    view port....or is the light bulb getting dimmer?

    Gary
     
    R. Robert Bell, Jun 3, 2004
    #6
  7. GaryDF

    GaryDF Guest

    Thanks again for your help. I understand what your talking about now.

    Gary
     
    GaryDF, Jun 3, 2004
    #7
  8. Happy I could help!

    --
    R. Robert Bell


    Thanks again for your help. I understand what your talking about now.

    Gary
     
    R. Robert Bell, Jun 3, 2004
    #8
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.