RVTDocs.com
Namespace: Autodesk.Revit.DB

LayoutRuleMaximumSpacing

Class
Description:
This class indicate the layout rule of a Beam System is Max-Spacing.
Remarks:
To use this type of LayoutRule, only the maximum spacing must be set and it must be in (0, 30000).
Inheritance Hierarchy:
System.Object
  Autodesk.Revit.DB.APIObject
    Autodesk.Revit.DB.LayoutRule
      Autodesk.Revit.DB.LayoutRuleMaximumSpacing
Syntax
public class LayoutRuleMaximumSpacing : LayoutRule
Examples
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;
}