Creates a new Line BoundaryConditions element on a reference.
Namespace: Autodesk.Revit.Creation
Assembly: RevitAPI (in RevitAPI.dll) Version: 23.0.0.0 (23.1.0.0)
Syntax
C# |
---|
|
Visual Basic |
---|
|
Visual C++ |
---|
|
Parameters
- reference
- Type: Autodesk.Revit.DB Reference
The Geometry reference to a Beam's, Wall's, Wall Foundation's, Slab's or Slab Foundation's analytical line.
- X_Translation
- Type: Autodesk.Revit.DB.Structure TranslationRotationValue
A value indicating the X axis translation option.
- X_TranslationSpringModulus
- Type: System Double
Translation Spring Modulus for X axis. Ignored if X_Translation is not "Spring".
- Y_Translation
- Type: Autodesk.Revit.DB.Structure TranslationRotationValue
A value indicating the Y axis translation option.
- Y_TranslationSpringModulus
- Type: System Double
Translation Spring Modulus for Y axis. Ignored if Y_Translation is not "Spring".
- Z_Translation
- Type: Autodesk.Revit.DB.Structure TranslationRotationValue
A value indicating the Z axis translation option.
- Z_TranslationSpringModulus
- Type: System Double
Translation Spring Modulus for Z axis. Ignored if Z_Translation is not "Spring".
- X_Rotation
- Type: Autodesk.Revit.DB.Structure TranslationRotationValue
A value indicating the option for rotation about the X axis.
- X_RotationSpringModulus
- Type: System Double
Rotation Spring Modulus for X axis. Ignored if X_Rotation is not "Spring"
Return Value
If successful, NewLineBoundaryConditions returns an object for the newly created BoundaryConditions with the BoundaryType = 1 - "Line". a null reference ( Nothing in Visual Basic) is returned if the operation fails.Remarks
This method will only function with the Autodesk Revit Structure application.
Examples

bool CreateLineConditionWithReference(AnalyticalMember column, Autodesk.Revit.Creation.Document docCreation)
{
if (column.StructuralRole != AnalyticalStructuralRole.StructuralRoleColumn)
{
throw new Exception("This sample only work for columns.");
}
// Get the line reference for the column analytical model
Reference lineReference = null;
AnalyticalModelSelector selector = new AnalyticalModelSelector(column.GetCurve());
lineReference = column.GetReference(selector);
if (null == lineReference)
{
throw new Exception("Unable to get reference line for selected column.");
}
// Create line Boundary Conditions for the column
BoundaryConditions condition = docCreation.NewLineBoundaryConditions(lineReference, TranslationRotationValue.Fixed, 0,
TranslationRotationValue.Fixed, 0,
TranslationRotationValue.Fixed, 0,
TranslationRotationValue.Fixed, 0);
return (null != condition);
}

Private Function CreateLineConditionWithReference(column As FamilyInstance, docCreation As Autodesk.Revit.Creation.Document) As Boolean
If StructuralType.Column <> column.StructuralType Then
Throw New Exception("This sample only work for columns.")
End If
' Get the line reference for the column analytical model
Dim lineReference As Reference = Nothing
Dim analyticalModel As Autodesk.Revit.DB.Structure.AnalyticalElement = Nothing
Dim document As Document = column.Document
Dim relManager As Autodesk.Revit.DB.Structure.AnalyticalToPhysicalAssociationManager = Autodesk.Revit.DB.Structure.AnalyticalToPhysicalAssociationManager.GetAnalyticalToPhysicalAssociationManager(document)
If (relManager Is Nothing) Then
Return False
End If
Dim counterpartId As ElementId = relManager.GetAssociatedElementId(column.Id)
If (counterpartId Is Nothing) Then
Return False
End If
analyticalModel = document.GetElement(counterpartId)
Dim selector As AnalyticalModelSelector = New AnalyticalModelSelector(analyticalModel.GetCurve())
lineReference = analyticalModel.GetReference(selector)
If lineReference Is Nothing Then
Throw New Exception("Unable to get reference line for selected column.")
End If
' Create line Boundary Conditions for the column
Dim condition As BoundaryConditions = docCreation.NewLineBoundaryConditions(lineReference, TranslationRotationValue.Fixed, 0, TranslationRotationValue.Fixed, 0, TranslationRotationValue.Fixed, _
0, TranslationRotationValue.Fixed, 0)
Return (condition IsNot Nothing)
End Function