Community
did you figure it out?
I'd love a toggle keyboard shortcut to view and hide ref planes.
I was able to get this in some code I wrote. If i reme....ah heck...let me go find it and cut and past...hang on.
Public Sub toggleOneCategory(ByVal catName As String) Dim oneCat As Autodesk.Revit.DB.Category Dim aView As Autodesk.Revit.DB.View Dim docTransaction As New Autodesk.Revit.DB.Transaction(ptrToDoc) aView = ptrToDoc.ActiveView For Each oneCat In ptrToDoc.Settings.Categories If oneCat.Name = catName Then 'Dim dog As String = "" Try docTransaction.SetName("stg - quickToggle") docTransaction.Start() Dim oldVis As Boolean oldVis = aView.getVisibility(oneCat) aView.setVisibility(oneCat, Not oldVis) docTransaction.Commit() Catch ex As Exception MsgBox(ex.ToString) End Try End If Next End Sub
Using a built in category is probably better, but similar idea.
lol...oh...and i've since learned from Jeremy that wrapping this sub/function in a try/catch is not good coding.
Additionally, if i should probably have exited the for loop, once found.
i'm learning. 🙂