LoadCombination Class


An object that represents a load combination.

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

Syntax

C#
public class LoadCombination : Element
Visual Basic
Public Class LoadCombination _
	Inherits Element
Visual C++
public ref class LoadCombination : public Element

Examples

Copy C#
private void CombinationInformation(LoadCombination loadCombination)
{
    StringBuilder information = new StringBuilder();

    //Get the string with Load Combination Name or empty string
    information.Append("\n\nCombination Name: " + loadCombination.Name);

    //Get the string with Load Combination State
    information.Append("\nCombination state: " + loadCombination.CombinationState);

    //Load Combination State index or 0
    information.Append("\nState index : " + loadCombination.CombinationStateIndex.ToString());

    //Get the string with Load Combination Type
    information.Append("\nCombination type: " + loadCombination.CombinationType);

    //Get Load Combination Type index or 0
    information.Append("\nType index: " + loadCombination.CombinationTypeIndex.ToString());

    //Get the number of Load Combination Components 
    int componentsNumber = loadCombination.NumberOfComponents;
    information.Append("\nComponents number: " + componentsNumber.ToString());
    for (int j = 0; j < componentsNumber; j++)
    {
        double factor = loadCombination.get_Factor(j);
        string caseName = loadCombination.get_CombinationCaseName(j);
        information.Append("\nCase name[" + j.ToString() + "]: " + caseName + "  factor: " +
                              factor.ToString());
    }

    //return the number of usage in the combination
    int usageNumber = loadCombination.NumberOfUsages;
    information.Append("\nNumber of usages: " + usageNumber + "\nUsage names: ");
    //get each usage name
    for (int i = 0; i < usageNumber; i++)
    {
        information.Append(loadCombination.get_UsageName(i) + "  ");
    }

    TaskDialog.Show("Revit",information.ToString());
}
Copy VB.NET
Private Sub CombinationInformation(loadCombination As LoadCombination)
    Dim information As New StringBuilder()

    'Get the string with Load Combination Name or empty string
    information.Append(vbLf & vbLf & "Combination Name: " & Convert.ToString(loadCombination.Name))

    'Get the string with Load Combination State
    information.Append(vbLf & "Combination state: " & Convert.ToString(loadCombination.CombinationState))

    'Load Combination State index or 0
    information.Append(vbLf & "State index : " & loadCombination.CombinationStateIndex.ToString())

    'Get the string with Load Combination Type
    information.Append(vbLf & "Combination type: " & Convert.ToString(loadCombination.CombinationType))

    'Get Load Combination Type index or 0
    information.Append(vbLf & "Type index: " & loadCombination.CombinationTypeIndex.ToString())

    'Get the number of Load Combination Components 
    Dim componentsNumber As Integer = loadCombination.NumberOfComponents
    information.Append(vbLf & "Components number: " & componentsNumber.ToString())
    For j As Integer = 0 To componentsNumber - 1
        Dim factor As Double = loadCombination.Factor(j)
        Dim caseName As String = loadCombination.CombinationCaseName(j)
        information.Append(vbLf & "Case name[" & j.ToString() & "]: " & caseName & "  factor: " & factor.ToString())
    Next

    'return the number of usage in the combination
    Dim usageNumber As Integer = loadCombination.NumberOfUsages
    information.Append(vbLf & "Number of usages: " & usageNumber & vbLf & "Usage names: ")
    'get each usage name
    For i As Integer = 0 To usageNumber - 1
        information.Append(loadCombination.UsageName(i) & "  ")
    Next

    TaskDialog.Show("Revit", information.ToString())
End Sub

Inheritance Hierarchy

System Object
Autodesk.Revit.DB Element
Autodesk.Revit.DB.Structure LoadCombination

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 →