Hi,
For a project I need to prevent the user to modify objects which belong to a specific Layer.
below is my VBA code to do this.I used "SelectionChanged" event to trigger the program. I can loop through objects that are selected by user.The problem starts when I want to deselect the objects that are in "Block" layer. Actually, I can't find any way to deselect them.I will be very glad if you can help me.Many thanks in advance
Private Sub AcadDocument_SelectionChanged()
Dim pfSS As AcadSelectionSet
Dim ssobject As AcadEntity
Dim msg As String
msg = vbCrLf
Set pfSS = ThisDrawing.PickfirstSelectionSet
For Each ssobject In pfSS
If ssobject.Layer = "Block" Then
'' Here I dont know how to deselect!!
msg = msg & vbCrLf & ssobject.ObjectName
MsgBox "The Block Object Type Is: " & msg
End If
Next ssobject
End Sub