LayoutRuleMaximumSpacing Class


This class indicate the layout rule of a Beam System is Max-Spacing.

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

Syntax

C#
public class LayoutRuleMaximumSpacing : LayoutRule
Visual Basic
Public Class LayoutRuleMaximumSpacing _
	Inherits LayoutRule
Visual C++
public ref class LayoutRuleMaximumSpacing : public LayoutRule

Remarks

To use this type of LayoutRule, only the maximum spacing must be set and it must be in (0, 30000).

Examples

Copy C#
private bool LayoutRuleMaximumSpacingInformation(BeamSystem beamSystem)
{
    //get the layoutRule of the beamsystem
    Autodesk.Revit.DB.LayoutRule layoutRule = beamSystem.LayoutRule;

    string message = "BeamSystem layout rule : " + layoutRule;

    //create a new instance of the LayoutRuleClearSpacing class 
    LayoutRuleMaximumSpacing myLayoutRuleMaximumSpacing =
                        new LayoutRuleMaximumSpacing(10.0);

    //set the new layoutRule to the beamsystem
    beamSystem.LayoutRule = myLayoutRuleMaximumSpacing;

    LayoutRuleMaximumSpacing maximunSpacing = beamSystem.LayoutRule as LayoutRuleMaximumSpacing;
    if (null == maximunSpacing)
    {
        return false;
    }
    //try to get the property value of the beamsystem LayoutRule
    double spacing = maximunSpacing.Spacing;

    message += "\nNew BeamSystem layout rule: " + maximunSpacing;
    message += "\nNew BeamSystem maximum spacing: " + spacing;

    TaskDialog.Show("Revit",message);

    return true;
}
Copy VB.NET
Private Function LayoutRuleMaximumSpacingInformation(beamSystem As BeamSystem) As Boolean
    'get the layoutRule of the beamsystem
    Dim layoutRule As Autodesk.Revit.DB.LayoutRule = beamSystem.LayoutRule

    Dim message As String = "BeamSystem layout rule : " & layoutRule.ToString()

    'create a new instance of the LayoutRuleClearSpacing class 
    Dim myLayoutRuleMaximumSpacing As New LayoutRuleMaximumSpacing(10.0)

    'set the new layoutRule to the beamsystem
    beamSystem.LayoutRule = myLayoutRuleMaximumSpacing

    Dim maximunSpacing As LayoutRuleMaximumSpacing = TryCast(beamSystem.LayoutRule, LayoutRuleMaximumSpacing)
    If maximunSpacing Is Nothing Then
        Return False
    End If
    'try to get the property value of the beamsystem LayoutRule
    Dim spacing As Double = maximunSpacing.Spacing

    message += vbLf & "New BeamSystem layout rule: " & maximunSpacing.ToString()
    message += vbLf & "New BeamSystem maximum spacing: " & spacing

    TaskDialog.Show("Revit", message)

    Return True
End Function

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 →