I still have this.... Allows you to select objects to turn the "off" and also turns on all objects that have been turned off.
Option Explicit
Public Const strProduct_Control = "Visibility"
Public Const strVersion_Control = " v2000.01"
Sub ObjectVisOn()
Dim objElem As Object
Dim objLayer As Object
Dim objLayers As Object
Dim objNewSS As Object
Dim dblPT1(0 To 2) As Double
Dim dblPT2(0 To 2) As Double
Dim strCurrLayer As String
Dim intGPC(0) As Integer
Dim varGPV(0) As Variant
intGPC(0) = 60
varGPV(0) = 1
Set objLayers = ThisDrawing.Layers
Set objNewSS = ThisDrawing.SelectionSets.Add("VBA")
objNewSS.Select acSelectionSetAll, dblPT1, dblPT2, intGPC, varGPV
For Each objElem In objNewSS
If objElem.Visible = False Then
strCurrLayer = objElem.Layer
Set objLayer = objLayers.Item(strCurrLayer)
If objLayer.Lock Then
objLayer.Lock = False
objElem.Visible = True
objLayer.Lock = True
Else
objElem.Visible = True
End If
End If
objElem.Update
Next
MsgBox "Done Processing entire drawing.", vbInformation, strProduct_Control & strVersion_Control
If Not objNewSS Is Nothing Then
objNewSS.Delete
End If
End Sub
Sub ObjectVisOff()
Dim objNewSS As Object
Dim strCurrLayer As String
Dim objLayer As Object
Dim objLayers As Object
Dim SSentity As Object
Set objLayers = ThisDrawing.Layers
Set objNewSS = ThisDrawing.SelectionSets.Add("VBA")
objNewSS.SelectOnScreen
For Each SSentity In objNewSS
strCurrLayer = SSentity.Layer
Set objLayer = objLayers.Item(strCurrLayer)
If objLayer.Lock Then
objLayer.Lock = False
SSentity.Visible = False
objLayer.Lock = True
Else
SSentity.Visible = False
End If
SSentity.Update
Next
MsgBox "Done Processing: " & Str(objNewSS.Count) & " Drawing Objects", vbInformation, strProduct_Control & strVersion_Control
If Not objNewSS Is Nothing Then
objNewSS.Delete
End If
End Sub