Creates a new rectangular profile wall within the project using the default wall style. 
   Namespace:   Autodesk.Revit.DB  
  Assembly:   RevitAPI  (in RevitAPI.dll) Version: 21.0.0.0 (21.1.1.109) 
Syntax
| C# | 
|---|
|  | 
| Visual Basic | 
|---|
|  | 
| Visual C++ | 
|---|
|  | 
Parameters
- document
-  Type:  Autodesk.Revit.DB Document  
 The document in which the new wall is created.
- curve
-  Type:  Autodesk.Revit.DB Curve  
 A curve representing the base line of the wall.
- levelId
-  Type:  Autodesk.Revit.DB ElementId  
 Id of the level on which the wall is to be placed.
- structural
-  Type:  System Boolean  
 If set, specifies that the wall is structural in nature.
Return Value
If successful a new wall object within the project.Examples
 Copy  C#
 Copy  C# public Wall CreateWallUsingCurve1(Autodesk.Revit.DB.Document document, Level level)
{
    // Build a location line for the wall creation
    XYZ start = new XYZ(0, 0, 0);
    XYZ end = new XYZ(10, 10, 0);
    Line geomLine = Line.CreateBound(start, end);
    // Create a wall using the location line
    return Wall.Create(document, geomLine, level.Id, true);
} Copy  VB.NET
 Copy  VB.NET Public Function CreateWallUsingCurve1(document As Autodesk.Revit.DB.Document, level As Level) As Wall
    ' Build a location line for the wall creation
    Dim start As New XYZ(0, 0, 0)
    Dim [end] As New XYZ(10, 10, 0)
    Dim geomLine As Line = Line.CreateBound(start, [end])
    ' Create a wall using the location line
    Return Wall.Create(document, geomLine, level.Id, True)
End FunctionExceptions
| Exception | Condition | 
|---|---|
| Autodesk.Revit.Exceptions ArgumentException | The curve argument is not valid for wall creation. | 
| Autodesk.Revit.Exceptions ArgumentNullException | A non-optional argument was NULL | 
| Autodesk.Revit.Exceptions ModificationForbiddenException | The document is in failure mode: an operation has failed, and Revit requires the user to either cancel the operation or fix the problem (usually by deleting certain elements). -or- The document is being loaded, or is in the midst of another sensitive process. | 
| Autodesk.Revit.Exceptions ModificationOutsideTransactionException | The document has no open transaction. |