© 2010 Autodesk
Introduction to Revit 2011 API
要素の編集
 要素 のタイプを変更
§壁とドアのタイプを変更
<VB.NET>
    ''  e.g., an element we are given is a wall.          
    Dim aWall As Wall = elem
    ''  find a wall family type with the given name.         
    Dim newWallType As Element = ElementFiltering.FindFamilyType( m_rvtDoc, _
         GetType(WallType), “標準壁", "外壁-レンガ")
    ''  assign a new family type.          
    aWall.WallType = newWallType
</VB.NET>
<VB.NET>
    ''  e.g., an element we are given is a door.          
    Dim aDoor As FamilyInstance = elem
    ''  find a door family type with the given name.         
    Dim newDoorType As Element = ElementFiltering.FindFamilyType( _ 
         GetType(FamilySymbol), "片開", "w700h2000", _
         BuiltInCategory.OST_Doors)
    ''  assign a new family type.          
    aDoor.Symbol = newDoorType
</VB.NET>
上のコードは壁を取得して、要素フィルタで“外壁ーレンガ”タイプを見つけて、それを壁のタイプを“外壁ーレンガに変更しています。

下のコードはドアを取得し、要素フィルタで“w700h2000”というタイプを見つけて、ドアをそのタイプに変更しています。