Results 1 to 1 of 1

Thread: Event Handler to toggle LTScale between MS/PS

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    The Silent Type RobertB's Avatar
    Join Date
    2000-01
    Location
    Seattle WA USA
    Posts
    5,859
    Login to Give a bone
    0

    Lightbulb Event Handler to toggle LTScale between MS/PS

    This code should serve only as a simple boilerplate to give you a start in making an event handler that toggles LTScale when you switch from ModelSpace to a Layout. It needs to be placed in the ThisDrawing object.

    It makes the assumption that the current DimScale is the scale factor you want for ModelSpace. This is a poor assumption IMHO, but you can decide how you want to store the scale factor yourself. (I might suggest a Dictionary/XRecord.)

    This sample regens the active viewport, but I have only tested this in AutoCAD 2004/2005. older versions might go unstable with the regen in there, so please test well before you use in an earlier environment.

    Code:
    Private Sub AcadDocument_LayoutSwitched(ByVal LayoutName As String)
      Dim sf As Double
      With ThisDrawing
        If UCase(LayoutName) <> "MODEL" Then
          sf = 1#
        ElseIf .GetVariable("DimScale") = 0 Then
          sf = 1#
        Else
          sf = .GetVariable("DimScale")
        End If
        .SetVariable "LTScale", 0.5 * sf
        .Regen acActiveViewport
      End With
    End Sub
    Last edited by RobertB; 2004-06-05 at 03:54 AM.

Similar Threads

  1. Replies: 9
    Last Post: 2014-07-07, 02:40 AM
  2. How to set error handler
    By avinash patil in forum AutoLISP
    Replies: 4
    Last Post: 2014-04-23, 02:13 PM
  3. event reactor for ltscale
    By rolibolibo in forum AutoLISP
    Replies: 2
    Last Post: 2005-07-21, 06:23 PM
  4. Reactor to toggle LTScale between MS/PS
    By RobertB in forum AutoLISP
    Replies: 19
    Last Post: 2004-06-29, 12:39 PM
  5. Slope Defining Toggle should act like Constrain Toggle
    By gregcashen in forum Revit Architecture - Wish List
    Replies: 0
    Last Post: 2004-01-15, 10:17 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •