Private Sub ACADApp_BeginCommand(ByVal CommandName As String)
Dim Ssett2 As AcadSelectionSet
Dim Blocks As AcadBlockReference
Dim II As Integer
Dim AttarrayY As Variant
Dim Varatts As AcadAttributeReference
Dim Viewobj_center(0 To 2) As Double
Dim SelBlock(0) As AcadEntity
On Error GoTo ErrorHandler
Set Ssett2 = thisdrawing.ActiveSelectionSet
thisdrawing.ActiveSelectionSet.Clear
If CommandName = "ERASE" Or CommandName = "SELECT" Then
'If Ssett2.count < 2 Then
' Set Ssett2 = thisdrawing.SelectionSets.Add("XXX")
' Ssett2.SelectOnScreen
' End If
For Each Blocks In Ssett2
If Blocks.ObjectName = "AcDbBlockReference" Then
If ((Blocks.HasAttributes) And (Left(Blocks.Name, 3) = "G_B") Or (Left(Blocks.Name, 3) = "G_E") Or (Left(Blocks.Name, 3) = "G_I") Or (Left(Blocks.Name, 3) = "G_L")) Then
thisdrawing.StartUndoMark
AttarrayY = Blocks.GetAttributes
For II = 0 To UBound(AttarrayY)
Set Varatts = AttarrayY(II)
If Varatts.TagString = "NOTE_2" And Varatts.TextString = "Checked" Then