»' Change the Type for selected Walls and Floors
»Dim sel As
ElementSet = doc.Selection.Elements
»Dim iWall As
Integer
»Dim el As
Revit.Element
»For Each el In
sel
» If TypeOf el Is Wall Then ' Check for walls
» Dim wall As Wall
= el
» iWall += 1
» Dim oldWallType
As WallType = wall.WallType
»
wall.WallType = newWallType
» MsgBox("Wall " &
iWall.ToString & ": Id=" & wall.Id.Value.ToString &
vbCrLf & _
» "
changed from OldType=" & oldWallType.Name & ";
Id=" & oldWallType.Id.Value.ToString & _
» "
to NewType=" & wall.WallType.Name & "; Id="
& wall.WallType.Id.Value.ToString)
» ElseIf
TypeOf el Is Floor Then
»
Dim f As Floor =
el
» iFloor += 1
» Dim oldFloorType
As FloorType = f.FloorType
» f.FloorType
= newFloorType
» MsgBox("Floor " &
iFloor.ToString & ": Id=" & f.Id.Value.ToString & vbCrLf
& _
» "
changed from OldType=" & oldFloorType.Name & ";
Id=" & oldFloorType.Id.Value.ToString & _
» "
to NewType=" & f.FloorType.Name & "; Id=" &
f.FloorType.Id.Value.ToString)
» End If
»Next