This class indicate the layout rule of a Beam System is Clear-Spacing.
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, the distance between the beams and the justify-type must be set.
Examples
Copy
C#
private bool LayoutRuleClearSpacingInformation(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
LayoutRuleClearSpacing myLayoutRuleClearSpacing =
new LayoutRuleClearSpacing(10.0, BeamSystemJustifyType.Beginning);
//set the new layoutRule to the beamsystem
beamSystem.LayoutRule = myLayoutRuleClearSpacing;
LayoutRuleClearSpacing clearSpacing = beamSystem.LayoutRule as LayoutRuleClearSpacing;
if (null == clearSpacing)
{
return false;
}
//try to get the property value of the beamsystem LayoutRule
BeamSystemJustifyType justifyType = clearSpacing.JustifyType;
double spacing = clearSpacing.Spacing;
message += "\nNew BeamSystem layout rule: " + clearSpacing;
message += "\nNew BeamSystem spacing: " + spacing;
message += "\nNew BeamSystem justification: " + justifyType;
TaskDialog.Show("Revit",message);
return true;
}
Copy
VB.NET
Private Function LayoutRuleClearSpacingInformation(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 myLayoutRuleClearSpacing As New LayoutRuleClearSpacing(10.0, BeamSystemJustifyType.Beginning)
'set the new layoutRule to the beamsystem
beamSystem.LayoutRule = myLayoutRuleClearSpacing
Dim clearSpacing As LayoutRuleClearSpacing = TryCast(beamSystem.LayoutRule, LayoutRuleClearSpacing)
If clearSpacing Is Nothing Then
Return False
End If
'try to get the property value of the beamsystem LayoutRule
Dim justifyType As BeamSystemJustifyType = clearSpacing.JustifyType
Dim spacing As Double = clearSpacing.Spacing
message += vbLf & "New BeamSystem layout rule: " & clearSpacing.ToString()
message += vbLf & "New BeamSystem spacing: " & spacing
message += vbLf & "New BeamSystem justification: " & justifyType
TaskDialog.Show("Revit", message)
Return True
End Function
Inheritance Hierarchy
System
Object
Autodesk.Revit.DB APIObject
Autodesk.Revit.DB LayoutRule
Autodesk.Revit.DB LayoutRuleClearSpacing
Autodesk.Revit.DB APIObject
Autodesk.Revit.DB LayoutRule
Autodesk.Revit.DB LayoutRuleClearSpacing