2021 Method
Changes 4
M

Document.NewPointBoundaryConditions

Description:
Creates a new Point BoundaryConditions Element.
Remarks:
This method will only function with the Autodesk Revit Structure application.
public BoundaryConditions NewPointBoundaryConditions(
	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,
	TranslationRotationValue Y_Rotation,
	double Y_RotationSpringModulus,
	TranslationRotationValue Z_Rotation,
	double Z_RotationSpringModulus
)
Return Value nullNothingnullptr If successful, NewPointBoundaryConditions returns an object for the newly created BoundaryConditions with the BoundaryType = 0 - "Point". null Nothing nullptr a null reference ( Nothing in Visual Basic) is returned if the operation fails.
bool CreatePointBoundaryCondition(Autodesk.Revit.DB.Document document, FamilyInstance column)
{
    // Get the start point reference of the column
    Reference startReference = null;
    AnalyticalModel analyticalModel = column.GetAnalyticalModel() as AnalyticalModel;

    if (null != analyticalModel)
    {
        startReference = analyticalModel.GetCurve().GetEndPointReference(0);
    }
    else 
    {
        throw new Exception("Cannot get end point for selected column");
    }

    // Get the Revit creation document
    Autodesk.Revit.Creation.Document docCreation = document.Create;

    // Create the Point Boundary Conditions for the start point
    BoundaryConditions condition = docCreation.NewPointBoundaryConditions(startReference, 
                                                                          TranslationRotationValue.Fixed, 0,
                                                                          TranslationRotationValue.Fixed, 0,
                                                                          TranslationRotationValue.Fixed, 0,
                                                                          TranslationRotationValue.Fixed, 0,
                                                                          TranslationRotationValue.Fixed, 0,
                                                                          TranslationRotationValue.Fixed, 0);
    if (null == condition)
    {
        throw new Exception("Can't create the point boundary condition for selected column start point.");
    }

    // Give the user some information
    TaskDialog.Show("Revit","Point boundary condition created successfully.");

    return (null != condition);
}