Skip to content

Solid

Public Class

A 3d solid.

Inheritance Hierarchy

System.Object
Autodesk.Revit.DB.APIObject
Autodesk.Revit.DB.GeometryObject
Autodesk.Revit.DB.Solid

Namespace: Autodesk.Revit.DB

Assembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)

Syntax

public class Solid : GeometryObject

The Solid type exposes the following members.

Properties

Name

Description


Public Property

The edges that belong to the solid.


Public Property
Code Example
Faces

The faces that belong to the solid.


Public Property
Code Example
GraphicsStyleId

The ElementId of the GeometryObject’s GraphicsStyle
(Inherited from GeometryObject)


Public Property
Id

A unique integer identifying the GeometryObject in its associated non view-specific GeometryElement.
(Inherited from GeometryObject)


Public Property

Indicates whether this geometry is obtained directly from an Element.
(Inherited from GeometryObject)


Public Property
Code Example

Identifies if the object is read-only or modifiable.
(Inherited from APIObject)


Public Property
SurfaceArea

Returns the total surface area of this solid.


Public Property
Visibility

The visibility.
(Inherited from GeometryObject)


Public Property
Volume

Returns the signed volume of this solid.


Methods

Name

Description


Public Method
ComputeCentroid

Returns the Centroid of this solid.


Public Method
Dispose

Causes the object to release immediately any resources it may be utilizing.
(Inherited from APIObject)


Public Method
Equals

Determines whether the specified Object is equal to the current Object.
(Inherited from GeometryObject)


Public Method
GetBoundingBox

Retrieves a box that circumscribes the solid geometry.


Public Method

Gets the integer value of the geometry object as hash code
(Inherited from GeometryObject)


Public Method

GetType

Gets the Type of the current instance.
(Inherited from Object)


Public Method
Code Example

Calculates and returns the intersection between a curve and this solid.


Public Method

ToString

Returns a string that represents the current object.
(Inherited from Object)


Remarks

A solid is defined by the faces and edges that form its boundary.

Example

private void GetAndTransformSolidInfo(Application application, Element element, Options geoOptions)
{
// Get geometry element of the selected element
Autodesk.Revit.DB.GeometryElement geoElement = element.get_Geometry(geoOptions);
// Get geometry object
foreach (GeometryObject geoObject in geoElement)
{
// Get the geometry instance which contains the geometry information
Autodesk.Revit.DB.GeometryInstance instance = geoObject as Autodesk.Revit.DB.GeometryInstance;
if (null != instance)
{
foreach (GeometryObject instObj in instance.SymbolGeometry)
{
Solid solid = instObj as Solid;
if (null == solid || 0 == solid.Faces.Size || 0 == solid.Edges.Size)
{
continue;
}
Transform instTransform = instance.Transform;
// Get the faces and edges from solid, and transform the formed points
foreach (Face face in solid.Faces)
{
Mesh mesh = face.Triangulate();
foreach (XYZ ii in mesh.Vertices)
{
XYZ point = ii;
XYZ transformedPoint = instTransform.OfPoint(point);
}
}
foreach (Edge edge in solid.Edges)
{
foreach (XYZ ii in edge.Tessellate())
{
XYZ point = ii;
XYZ transformedPoint = instTransform.OfPoint(point);
}
}
}
}
}
}