This class indicate the layout rule of a Beam System is Fixed-Number.
Namespace:
Autodesk.Revit.DB
Assembly:
RevitAPI
(in RevitAPI.dll) Version: 2015.0.0.0 (2015.0.0.0)
Syntax
C# |
---|
|
Visual Basic |
---|
|
Visual C++ |
---|
|
Remarks
To use this type of LayoutRule, only the number of the beams must be set.
Examples
Copy
C#
private bool LayoutRuleFixedNumberInformation(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
LayoutRuleFixedNumber myLayoutRuleFixedNumber =
new LayoutRuleFixedNumber(8);
//set the new layoutRule to the beamsystem
beamSystem.LayoutRule = myLayoutRuleFixedNumber;
LayoutRuleFixedNumber fixedNumber = beamSystem.LayoutRule as LayoutRuleFixedNumber;
if (null == fixedNumber)
{
return false;
}
//try to get the property value of the beamsystem LayoutRule
int numberOfLines = fixedNumber.NumberOfLines;
message += "\nNew BeamSystem layout rule: " + fixedNumber;
message += "\nNew BeamSystem number of beams: " + numberOfLines;
TaskDialog.Show("Revit",message);
return true;
}
Copy
VB.NET
Private Function LayoutRuleFixedNumberInformation(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 myLayoutRuleFixedNumber As New LayoutRuleFixedNumber(8)
'set the new layoutRule to the beamsystem
beamSystem.LayoutRule = myLayoutRuleFixedNumber
Dim fixedNumber As LayoutRuleFixedNumber = TryCast(beamSystem.LayoutRule, LayoutRuleFixedNumber)
If fixedNumber Is Nothing Then
Return False
End If
'try to get the property value of the beamsystem LayoutRule
Dim numberOfLines As Integer = fixedNumber.NumberOfLines
message += vbLf & "New BeamSystem layout rule: " & fixedNumber.ToString()
message += vbLf & "New BeamSystem number of beams: " & numberOfLines
TaskDialog.Show("Revit", message)
Return True
End Function
Inheritance Hierarchy
System
Object
Autodesk.Revit.DB APIObject
Autodesk.Revit.DB LayoutRule
Autodesk.Revit.DB LayoutRuleFixedNumber
Autodesk.Revit.DB APIObject
Autodesk.Revit.DB LayoutRule
Autodesk.Revit.DB LayoutRuleFixedNumber