Profile Class


A geometric profile consisting of a loop of curves.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 16.0.0.0 (16.0.0.0)

Syntax

C#
public class Profile : GeometryObject
Visual Basic
Public Class Profile _
	Inherits GeometryObject
Visual C++
public ref class Profile : public GeometryObject

Remarks

The profile may be filled.

Examples

Copy C#
public void GetProfile(Element element)
{
    string messageInfo = "Profile : ";
    if (element is FamilyInstance)
    {
        FamilyInstance beam = element as FamilyInstance;
        if (beam.StructuralType == StructuralType.Beam)
        {
            // Get swept profile
            Autodesk.Revit.DB.SweptProfile sweptProfile = beam.GetSweptProfile();
            Autodesk.Revit.DB.Profile profile = sweptProfile.GetSweptProfile();
            // Get swept profile curves size
            messageInfo += "\nSelection name : " + beam.Name;
            messageInfo += "\nSwept Profile Driving Curve size is " + profile.Curves.Size;
            messageInfo += "\nProfile is filled :  " + profile.Filled;
            if (!profile.IsReadOnly)
            {
                profile.Filled = !profile.Filled;
                messageInfo += "\nProfile is filled after setting:  " + profile.Filled;
            }
            TaskDialog.Show("Revit",messageInfo);
        }
    }
}
Copy VB.NET
Public Sub GetProfile(element As Element)
    Dim messageInfo As String = "Profile : "
    If TypeOf element Is FamilyInstance Then
        Dim beam As FamilyInstance = TryCast(element, FamilyInstance)
        If beam.StructuralType = StructuralType.Beam Then
       ' Get swept profile
       Dim sweptProfile As Autodesk.Revit.DB.SweptProfile = beam.GetSweptProfile()
            Dim profile As Autodesk.Revit.DB.Profile = sweptProfile.GetSweptProfile()
       ' Get swept profile curves size
            messageInfo += vbLf & "Selection name : " + beam.Name
            messageInfo += vbLf & "Swept Profile Driving Curve size is " + profile.Curves.Size
            messageInfo += vbLf & "Profile is filled :  " + profile.Filled
            If Not profile.IsReadOnly Then
                profile.Filled = Not profile.Filled
                messageInfo += vbLf & "Profile is filled after setting:  " + profile.Filled
            End If
            TaskDialog.Show("Revit", messageInfo)
        End If
    End If
End Sub

Inheritance Hierarchy

See Also

ArchiLabs

Stop fighting Revit automation.

Build repeatable BIM design and documentation workflows with scripts, data, and AI in one place, without wrestling brittle one-off automations.

Try ArchiLabs →