RVTDocs.com
Namespace: Autodesk.Revit.DB

Profile

Class
Description:
A geometric profile consisting of a loop of curves.
Remarks:
The profile may be filled.
Inheritance Hierarchy:
System.Object
  Autodesk.Revit.DB.APIObject
    Autodesk.Revit.DB.GeometryObject
      Autodesk.Revit.DB.Profile
Syntax
public class Profile : GeometryObject
Examples
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);
        }
    }
}