LayoutRuleFixedDistance Class


Layout Rule Fixed Distance Class

This class indicate the layout rule of a Beam System is Fixed-Distance.
Inheritance Hierarchy

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

The LayoutRuleFixedDistance type exposes the following members.

Constructors
Name Description
Public method LayoutRuleFixedDistance Constructor of LayoutRuleFixedDistance. Create LayoutRuleFixedDistance with the values passed in.
Top
Properties
Name Description
Public property Code example IsReadOnly Identifies if the object is read-only or modifiable.
(Inherited from APIObject )
Public property JustifyType Get or set the type of justification.
Public property Spacing Get or set spacing of the Beam System.
Top
Methods
Name Description
Public method Dispose Causes the object to release immediately any resources it may be utilizing.
(Inherited from APIObject )
Public method Equals Determines whether the specified object is equal to the current object.
(Inherited from Object )
Public method GetHashCode Serves as the default hash function.
(Inherited from Object )
Public method GetType Gets the Type of the current instance.
(Inherited from Object )
Public method ToString Returns a string that represents the current object.
(Inherited from Object )
Top
Remarks
To use this type of LayoutRule, the distance between the beams and the justify-type must be set.
Example
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;
}
See Also