PPT_LOGO_4b
Revit Programming Introduction <#>
Copyright © 2009 Autodesk Inc.
壁と床タイプを変更
»' 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
ファミリーとタイプ
lab3-5-5 lab3-5-7
壁と床のタイプの変更には、該当するプロパティの値を変更します。
wall.WallType = newWallType
f.FloorType = newFloorType
の行がその部分になります。