»' List the app, doc and view data
»Dim revitApp As
Revit.Application = commandData.Application
»Dim doc As Revit.Document = revitApp.ActiveDocument
»Dim view As Revit.Elements.View = commandData.View
»
»Dim sMsg As String = "Application
= " &
revitApp.VersionName & " " _
»
&
revitApp.VersionNumber & vbCrLf
»sMsg += "Document path = " & doc.PathName & vbCrLf ' Empty if not
saved yet
»sMsg += "Document title = " & doc.Title & vbCrLf
»sMsg += "View name = " & view.Name
»MsgBox(sMsg)
»
»' List the current selection set
»Dim sel As Selection = doc.Selection
»
»sMsg = "There are " & sel.Elements.Size & " elements in the selection set:"
»Dim elem As Revit.Element
»For Each elem In sel.Elements
» sMsg += vbCrLf & " " & elem.Category.Name & "
Id=" & elem.Id.Value.ToString
»Next
»MsgBox(sMsg)