Floors, Ceilings and Foundations

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

Note: Floor and Ceiling derive from the class CeilingAndFloor.

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, when using the structural features of Revit, 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 Structural Engineering section.

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 Structural Engineering section). For example, the attached wall is not available with the architectural features of Revit. Using the structural features of Revit, 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 Structural Engineering section.

Figure 38: Wall Foundation

Modifying Slabs

You can modify the form of slab-based elements using the SlabShapeEditor class. This class allows you to:

  • Manipulate one or more of the points or edges on a selected slab-based element
  • Add points on the element to change the element's geometry
  • Add linear edges and split the existing face of a slab into smaller sub-regions
  • Remove the shape modifier and reset the element geometry back to the unmodified shape.

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.