Share

LayoutRuleFixedDistance Class

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

Inheritance Hierarchy

System.Object
  Autodesk.Revit.DB.APIObject
    Autodesk.Revit.DB.LayoutRule
      Autodesk.Revit.DB.LayoutRuleFixedDistance


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

Syntax

C#

public class LayoutRuleFixedDistance : LayoutRule

The LayoutRuleFixedDistance type exposes the following members.

Constructors

 NameDescription
Public methodLayoutRuleFixedDistanceConstructor of LayoutRuleFixedDistance. Create LayoutRuleFixedDistance with the values passed in.

Properties

 NameDescription
Public propertyCode exampleIsReadOnlyIdentifies if the object is read-only or modifiable.
(Inherited from APIObject)
Public propertyJustifyTypeGet or set the type of justification.
Public propertySpacingGet or set spacing of the Beam System.

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)

Remarks

To use this type of LayoutRule, the distance between the beams and the justify-type must be set.

Example

C#

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;
}

VB

Private Function LayoutRuleFixedDistanceInformation(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 myLayoutRuleFixedDistance As New LayoutRuleFixedDistance(10.0, BeamSystemJustifyType.[End])

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

    Dim fixedDistance As LayoutRuleFixedDistance = TryCast(beamSystem.LayoutRule, LayoutRuleFixedDistance)
    If fixedDistance Is Nothing Then
        Return False
    End If
    'try to get the property value of the beamsystem LayoutRule
    Dim justifyType As BeamSystemJustifyType = fixedDistance.JustifyType

    Dim spacing As Double = fixedDistance.Spacing

    message += vbLf & "New BeamSystem layout rule: " & fixedDistance.ToString()
    message += vbLf & "New BeamSystem spacing: " & spacing
    message += vbLf & "New BeamSystem justification: " & justifyType

    TaskDialog.Show("Revit", message)

    Return True
End Function

See Also

Reference

Was this information helpful?