LayoutRuleMaximumSpacing Class

This class indicate the layout rule of a Beam System is Max-Spacing.
Inheritance Hierarchy
SystemObject
  Autodesk.Revit.DBAPIObject
    Autodesk.Revit.DBLayoutRule
      Autodesk.Revit.DBLayoutRuleMaximumSpacing

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

The LayoutRuleMaximumSpacing type exposes the following members.

Constructors
 NameDescription
Public methodLayoutRuleMaximumSpacingConstructor of LayoutRuleMaximumSpacing.
Top
Properties
 NameDescription
Public propertyCode exampleIsReadOnlyIdentifies if the object is read-only or modifiable.
(Inherited from APIObject)
Public propertySpacingGet or set the spacing of the beam system.
Top
Methods
 NameDescription
Public methodDisposeCauses the object to release immediately any resources it may be utilizing.
(Inherited from APIObject)
Public methodEqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
Public methodGetHashCodeServes as the default hash function.
(Inherited from Object)
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Public methodToStringReturns a string that represents the current object.
(Inherited from Object)
Top
Remarks
To use this type of LayoutRule, only the maximum spacing must be set and it must be in (0, 30000).
Example
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;
}
See Also