Document.NewAreaBoundaryConditions(Reference, TranslationRotationValue, Double, TranslationRotationValue, Double, TranslationRotationValue, Double) Method

DocumentNewAreaBoundaryConditions(Reference, TranslationRotationValue, Double, TranslationRotationValue, Double, TranslationRotationValue, Double) Method

Creates a new Area BoundaryConditions element on a reference.

Namespace: Autodesk.Revit.Creation
Assembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)
Syntax
public BoundaryConditions NewAreaBoundaryConditions(
	Reference reference,
	TranslationRotationValue X_Translation,
	double X_TranslationSpringModulus,
	TranslationRotationValue Y_Translation,
	double Y_TranslationSpringModulus,
	TranslationRotationValue Z_Translation,
	double Z_TranslationSpringModulus
)
Public Function NewAreaBoundaryConditions ( 
	reference As Reference,
	X_Translation As TranslationRotationValue,
	X_TranslationSpringModulus As Double,
	Y_Translation As TranslationRotationValue,
	Y_TranslationSpringModulus As Double,
	Z_Translation As TranslationRotationValue,
	Z_TranslationSpringModulus As Double
) As BoundaryConditions
public:
BoundaryConditions^ NewAreaBoundaryConditions(
	Reference^ reference, 
	TranslationRotationValue X_Translation, 
	double X_TranslationSpringModulus, 
	TranslationRotationValue Y_Translation, 
	double Y_TranslationSpringModulus, 
	TranslationRotationValue Z_Translation, 
	double Z_TranslationSpringModulus
)
member NewAreaBoundaryConditions : 
        reference : Reference * 
        X_Translation : TranslationRotationValue * 
        X_TranslationSpringModulus : float * 
        Y_Translation : TranslationRotationValue * 
        Y_TranslationSpringModulus : float * 
        Z_Translation : TranslationRotationValue * 
        Z_TranslationSpringModulus : float -> BoundaryConditions 

Parameters

reference  Reference
The Geometry reference obtained from a Wall, Slab or Slab Foundation.
X_Translation  TranslationRotationValue
A value indicating the X axis translation option.
X_TranslationSpringModulus  Double
Translation Spring Modulus for X axis. Ignored if X_Translation is not "Spring".
Y_Translation  TranslationRotationValue
A value indicating the Y axis translation option.
Y_TranslationSpringModulus  Double
Translation Spring Modulus for Y axis. Ignored if Y_Translation is not "Spring".
Z_Translation  TranslationRotationValue
A value indicating the Z axis translation option.
Z_TranslationSpringModulus  Double
Translation Spring Modulus for Z axis. Ignored if Z_Translation is not "Spring".

Return Value

BoundaryConditions
If successful, NewAreaBoundaryConditions returns an object for the newly created BoundaryConditions with the BoundaryType = 2 - "Area". is returned if the operation fails.
Remarks
This method will only function with the Autodesk Revit Structure application.
Example
bool CreateAreaConditionWithReference(AnalyticalPanel wall, Autodesk.Revit.Creation.Document docCreation)
{
   // Get the Geometry reference to the wall
   Reference profileReference = null;
   if (null == wall)
   {
      return false; // the profile reference can't be retrieved.
   }

   // loop through the curves of the wall and get the first one as a reference
   foreach (Curve curve in wall.GetOuterContour())
   {
      AnalyticalModelSelector selector = new AnalyticalModelSelector(curve);

      profileReference = wall.GetReference(selector);
      if (null != profileReference)
      {
         break;
      }
   }
   BoundaryConditions condition = null;
   // Create the Area Boundary Conditions if we have a profileReference
   if (null != profileReference)
   {
      // Create Area Boundary Conditions with profile reference.
      condition = docCreation.NewAreaBoundaryConditions(profileReference, TranslationRotationValue.Fixed, 0,
                                                                          TranslationRotationValue.Fixed, 0,
                                                                          TranslationRotationValue.Fixed, 0);
   }
   return (null != condition);
}
Private Function CreateAreaConditionWithReference(wall As Wall, docCreation As Autodesk.Revit.Creation.Document) As Boolean
   ' Get the Geometry reference to the wall
   Dim profileReference As Reference = Nothing
   Dim document As Document = wall.Document
   Dim analytical As Autodesk.Revit.DB.Structure.AnalyticalPanel = Nothing
   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(wall.Id)
   If (counterpartId Is Nothing) Then
      Return False
   End If

   analytical = document.GetElement(counterpartId)
   If analytical Is Nothing Then
      ' the profile reference can't be retrieved.
      Return False
   End If

   ' loop through the curves of the wall and get the first one as a reference
   For Each curve As Curve In analytical.GetOuterContour().ToList()
      profileReference = curve.Reference
      If profileReference IsNot Nothing Then
         Exit For
      End If
   Next

   Dim condition As BoundaryConditions = Nothing
   ' Create the Area Boundary Conditions if we have a profileReference
   If profileReference IsNot Nothing Then
      ' Create Area Boundary Conditions with profile reference.
      condition = docCreation.NewAreaBoundaryConditions(profileReference, TranslationRotationValue.Fixed, 0, TranslationRotationValue.Fixed, 0, TranslationRotationValue.Fixed,
              0)
   End If
   Return (condition IsNot Nothing)
End Function

No code example is currently available or this language may not be supported.

No code example is currently available or this language may not be supported.

See Also