Profile Class


Profile Class

A geometric profile consisting of a loop of curves.
Inheritance Hierarchy

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)
Syntax
public class Profile : GeometryObject

The Profile type exposes the following members.

Properties
Name Description
Public property Curves Retrieve the curves that make up the boundary of the profile.
Public property Filled Get or set whether the profile is filled.
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 IsElementGeometry Indicates whether this geometry is obtained directly from an Element.
(Inherited from GeometryObject )
Public property Code example IsReadOnly Identifies if the object is read-only or modifiable.
(Inherited from APIObject )
Public property Transformed Transforms this profile and returns the result.
Public property Visibility The visibility.
(Inherited from GeometryObject )
Top
Methods
Name Description
Public method Clone Returns a copy of this profile.
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 GetHashCode 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 ToString Returns a string that represents the current object.
(Inherited from Object )
Top
Remarks
The profile may be filled.
Example
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);
        }
    }
}
See Also