2021 Method
Changes 4
M

Document.NewLineBoundaryConditions

Description:
Creates a new Line BoundaryConditions element on a reference.
Remarks:
This method will only function with the Autodesk Revit Structure application.
Overloads (2):
NewLineBoundaryConditions(Reference,TranslationRotationValue,Double,TranslationRotationValue,Double,TranslationRotationValue,Double,TranslationRotationValue,Double)
public BoundaryConditions NewLineBoundaryConditions(
	Reference reference,
	TranslationRotationValue X_Translation,
	double X_TranslationSpringModulus,
	TranslationRotationValue Y_Translation,
	double Y_TranslationSpringModulus,
	TranslationRotationValue Z_Translation,
	double Z_TranslationSpringModulus,
	TranslationRotationValue X_Rotation,
	double X_RotationSpringModulus
)
Return Value nullNothingnullptr If successful, NewLineBoundaryConditions returns an object for the newly created BoundaryConditions with the BoundaryType = 1 - "Line". null Nothing nullptr a null reference ( Nothing in Visual Basic) is returned if the operation fails.
bool CreateLineConditionWithReference(FamilyInstance column, Autodesk.Revit.Creation.Document docCreation)
{
    if (StructuralType.Column != column.StructuralType)
    {
        throw new Exception("This sample only work for columns.");
    }

    // Get the line reference for the column analytical model
    Reference lineReference = null;
    AnalyticalModel analytical = column.GetAnalyticalModel() as AnalyticalModel;
    lineReference = analytical.GetCurve().Reference;
    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);
}