Consulting

Results 1 to 2 of 2

Thread: Solved: Autocad - run routine when switching Layouts

  1. #1
    VBAX Regular
    Joined
    Mar 2005
    Posts
    11
    Location

    Solved: Autocad - run routine when switching Layouts

    As the title says, I want a routine to run when the user changes layouts by clicking on the model/layout tabs.

    TIA

  2. #2
    Moderator VBAX Master Tommy's Avatar
    Joined
    May 2004
    Location
    Houston, TX
    Posts
    1,184
    Location
    I found the code in acad's help/example files. Place the below code in the ThisDocument code pane. Replace the msgbox with your macro. Note: this maco should be a publically available macro.

    [VBA]
    Private Sub AcadDocument_LayoutSwitched(ByVal LayoutName As String)
    ' This example intercepts a drawing LayoutSwitched event.
    '
    ' This event is triggered when the user switches to a different
    ' drawing layout view.
    '
    ' To trigger this example event: Open a drawing and change its layout view
    '
    ' For example: Switch the drawing from Model view to Layout1 view
    ' Use the "LayoutName" variable to determine the which layout view we changed to
    MsgBox "The drawing layout was just changed to: " & LayoutName
    End Sub
    [/VBA]

Posting Permissions

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