A geometric profile consisting of a loop of curves.
Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 2015.0.0.0 (2015.0.0.0)
Syntax
C# |
---|
|
Visual Basic |
---|
|
Visual C++ |
---|
|
Remarks
The profile may be filled.
Examples

public void GetProfile(Element element)
{
string messageInfo = "Profile : ";
if (element is FamilyInstance)
{
FamilyInstance beam = element as FamilyInstance;
if (beam.StructuralType == StructuralType.Beam)
{
AnalyticalModel modelFrame = beam.GetAnalyticalModel() as AnalyticalModel;
Autodesk.Revit.DB.Curve curve = modelFrame.GetCurve();
// Get AnalyticalModel swept profile
Autodesk.Revit.DB.Structure.AnalyticalModelSweptProfile sweptProfile = modelFrame.GetSweptProfile();
Autodesk.Revit.DB.Profile profile = sweptProfile.GetSweptProfile();
// Get AnalyticalModel 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);
}
}
}

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
Dim modelFrame As AnalyticalModel = TryCast(beam.GetAnalyticalModel(), AnalyticalModel)
Dim curve As Autodesk.Revit.DB.Curve = modelFrame.GetCurve()
' Get AnalyticalModel swept profile
Dim sweptProfile As Autodesk.Revit.DB.Structure.AnalyticalModelSweptProfile = modelFrame.GetSweptProfile()
Dim profile As Autodesk.Revit.DB.Profile = sweptProfile.GetSweptProfile()
' Get AnalyticalModel 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
System Object
Autodesk.Revit.DB APIObject
Autodesk.Revit.DB GeometryObject
Autodesk.Revit.DB Profile
Autodesk.Revit.DB APIObject
Autodesk.Revit.DB GeometryObject
Autodesk.Revit.DB Profile