RVTDocs.com
Namespace: Autodesk.Revit.DB

LayoutRuleFixedDistance

Class
Description:
This class indicate the layout rule of a Beam System is Fixed-Distance.
Remarks:
To use this type of LayoutRule, the distance between the beams and the justify-type must be set.
Inheritance Hierarchy:
System.Object
  Autodesk.Revit.DB.APIObject
    Autodesk.Revit.DB.LayoutRule
      Autodesk.Revit.DB.LayoutRuleFixedDistance
Syntax
public class LayoutRuleFixedDistance : LayoutRule
Examples
private bool LayoutRuleFixedDistanceInformation(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 
    LayoutRuleFixedDistance myLayoutRuleFixedDistance =
                new LayoutRuleFixedDistance(10.0, BeamSystemJustifyType.End);

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

    LayoutRuleFixedDistance fixedDistance = beamSystem.LayoutRule as LayoutRuleFixedDistance;
    if (null == fixedDistance)
    {
        return false;
    }
    //try to get the property value of the beamsystem LayoutRule
    BeamSystemJustifyType justifyType = fixedDistance.JustifyType;

    double spacing = fixedDistance.Spacing;

    message += "\nNew BeamSystem layout rule: " + fixedDistance;
    message += "\nNew BeamSystem spacing: " + spacing;
    message += "\nNew BeamSystem justification: " + justifyType;

    TaskDialog.Show("Revit",message);

    return true;
}