<VB.NET>
''
identify the type of the element known to the UI.
Public Sub IdentifyElement(ByVal elem As Element)
Dim s As String = ""
If TypeOf elem Is Wall Then
s = "Wall"
ElseIf TypeOf elem Is Floor Then
s = "Floor"
ElseIf TypeOf elem Is RoofBase Then
s = "Roof"
ElseIf TypeOf elem Is FamilyInstance Then
'' An instance of a component family is all
FamilyInstance.
'' We'll need to further check its
category.
If
elem.Category.Id.IntegerValue = _
BuiltInCategory.OST_Doors Then
s = "Door"
ElseIf
elem.Category.Id.IntegerValue = _
BuiltInCategory.OST_Windows Then
s = "Window"
ElseIf
elem.Category.Id.IntegerValue = _
BuiltInCategory.OST_Furniture Then
s = "Furniture"
Else
s = "Component
family instance" '' e.g.
Plant
End If
...
</VB.NET>