Reacting to Ctrl-Shift -A (group toggle)

Discussion in 'AutoCAD' started by Allen Johnson, Jun 16, 2004.

  1. I have a button that changes state (supposedly) when the groups are on/off
    (Pickstyle bit 1 on/off).
    But the code below doesn't respond when the user keys Ctrl-Shift-A. Does
    anyone know what event would make it respond?

    Private Sub AcadDocument_EndCommand(ByVal CommandName As String)
    Dim ErrFlag As Boolean
    On Error GoTo ErrOut

    If CommandName = "SETVAR" Then
    SBBGroup.SetCurrentState ' < --- This line doesn't fire on Ctrl-Shift-A
    End If
    Exit Sub
    ......
    .....
     
    Allen Johnson, Jun 16, 2004
    #1
  2. Have you tried using the SysVarChanged event of the AcadApplication
    class?
     
    Frank Oquendo, Jun 16, 2004
    #2
  3. Didn't seem to work.

    The output (see the line "Command: <Group off> <Group on> <Group off>
    <Group on> ucsfollow " below):

    Command: Highlight
    Enter new value for HIGHLIGHT <1>: 0 The system variable HIGHLIGHT was just
    changed to: 0
    Command: ucsfollow
    Enter new value for UCSFOLLOW <1>: 0 The system variable UCSFOLLOW was just
    changed to: 0
    Command: ucsfollow
    Enter new value for UCSFOLLOW <0>: 1 The system variable UCSFOLLOW was just
    changed to: 1
    Command: PickStyle
    Enter new value for PICKSTYLE <1>: 0
    The system variable PICKSTYLE was just changed to: 0
    Command: PickStyle
    Enter new value for PICKSTYLE <0>: 1
    The system variable PICKSTYLE was just changed to: 1
    Command: <Group off> <Group on> <Group off> <Group on> ucsfollow
    <<<<< used Ctrl-Shift-A to toggle groups - note no reaction from the SVC
    class!>>>>>>>
    Enter new value for UCSFOLLOW <1>: 0 The system variable UCSFOLLOW was just
    changed to: 0
    Command: Highlight
    Enter new value for HIGHLIGHT <0>: 1 The system variable HIGHLIGHT was just
    changed to: 1

    The code:

    Public SVC As New clsSysVarChange

    Private Sub SVC_Initialize()
    Set SVC.ACADApp = ThisDrawing.Application
    End Sub

    Public Sub AddButtons()
    SVC_Initialize
    End Sub

    The class (clsSysVarChange):

    Option Explicit

    Public WithEvents ACADApp As AcadApplication ' Use with Application Event
    Examples

    Private Sub ACADApp_SysVarChanged(ByVal SysvarName As String, ByVal newVal
    As Variant)
    ' This example intercepts an Application SysVarChanged event.
    '
    ' This event is triggered when the value of a system variable is
    changed.
    '
    ' To trigger this example event:
    ' 1) Make sure to run the example that initializes
    ' the public variable (named ACADApp) linked to this event.
    '
    ' 2) Change the value of a system variable in AutoCAD.
    ' For example: Type GRIDMODE on the command line and toggle the grid
    display on/off

    ' Use the "SysvarName" and "newVal" variables to determine which
    ' system variable has changed and its new value.

    ThisDrawing.Utility.Prompt "The system variable " & SysvarName & " was
    just changed to: " & newVal

    End Sub
     
    Allen Johnson, Jun 17, 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.