Classes associated with floors, ceilings and foundations.
Floor, Ceiling and Foundation-related API items include:
Table 28: Floors, Ceilings and Foundations in the API
Object |
Element Type |
ElementType Type |
Element Creation |
Other |
Floor |
Floor |
FloorType |
NewFloor()/NewSlab() |
FloorType.IsFoundationSlab = false |
Slab |
Floor |
FloorType |
NewSlab() |
FloorType.IsFoundationSlab = false |
Ceiling | Ceiling | CeilingType | No |
Category = OST_Ceilings |
Wall Foundation |
WallFoundation |
WallFoundationType |
No |
Category = OST_StructuralFoundation |
Isolated Foundation |
FamilyInstance |
FamilySymbol |
NewFamilyInstance() |
Category = OST_StructuralFoundation |
Foundation Slab |
Floor |
FloorType |
NewFloor() |
Category = OST_StructuralFoundation FloorType.IsFoundationSlab = true |
The following rules apply to Floor:
When you retrieve FloorType to create a Floor or Foundation Slab with NewFloor, use the following methods:
Figure 35: Create foundation and floor/slab
Currently, the API does not provide access to the Floor Slope Arrow in the Floor class. However, in Revit Structure, you can create a sloped slab with NewSlab():
Code Region 11-1: NewSlab() |
public Floor NewSlab(CurveArray profile, Level level, Line slopedArrow, double slope, bool isStructural); |
The Slope Arrow is created using the slopedArrow parameter.
Figure 36: slopedArrow parameter in NewSlab
The unit for the slope parameter in NewSlab() is rise/run.
The Floor.FloorType property is an alternative to using the Floor.GetTypeId() method. For more information about structure-related members such as the GetSpanDirectionSymbolIds() method and the SpanDirectionAngle property, refer to the Revit Structure chapter.
When editing an Isolated Foundation in Revit, you can perform the following actions:
Figure 37: Pick Host for FoundationSlab (FamilyInstance)
Wall foundations are represented by the WallFoundation class in the API. The API provides limited access to both WallFoundation and WallFoundationType except when using the GetAnalyticalModel() method (refer to AnalyticalModel in the Revit Structure section). For example, the attached wall is not available in Revit Architecture. In Revit Structure, the relationship between the Wall class and the WallFoundation class is shown using the GetAnalyticalModelSupports() method in the AnalyticalModel class. For more details, refer to AnalyticalModelSupport in the Revit Structure section.
Figure 38: Wall Foundation
You can modify the form of slab-based elements using the SlabShapeEditor class. This class allows you to:
Here's an example of reverting a selected modified floor back to its original shape:
Code Region 11-2: Reverting a slab's shape |
private void ResetSlabShapes(Autodesk.Revit.DB.Document document) { UIDocument uidoc = new UIDocument(document); Selection choices = uidoc.Selection; ElementSet collection = choices.Elements; foreach (Autodesk.Revit.DB.Element elem in collection) { Floor floor = elem as Floor; if (floor != null) { SlabShapeEditor slabShapeEditor = floor.SlabShapeEditor; slabShapeEditor.ResetSlabShape(); } } } |
For more detailed examples of using the SlabShapeEditor and related classes, see the SlabShapeEditing sample application included in the Revit SDK.