Wall.Create(Document, Curve, ElementId, ElementId, Double, Double, Boolean, Boolean) Method

WallCreate(Document, Curve, ElementId, ElementId, Double, Double, Boolean, Boolean) Method

Creates a new rectangular profile wall within the project using the specified wall type, height, and offset.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)
Syntax
public static Wall Create(
	Document document,
	Curve curve,
	ElementId wallTypeId,
	ElementId levelId,
	double height,
	double offset,
	bool flip,
	bool structural
)
Public Shared Function Create ( 
	document As Document,
	curve As Curve,
	wallTypeId As ElementId,
	levelId As ElementId,
	height As Double,
	offset As Double,
	flip As Boolean,
	structural As Boolean
) As Wall
public:
static Wall^ Create(
	Document^ document, 
	Curve^ curve, 
	ElementId^ wallTypeId, 
	ElementId^ levelId, 
	double height, 
	double offset, 
	bool flip, 
	bool structural
)
static member Create : 
        document : Document * 
        curve : Curve * 
        wallTypeId : ElementId * 
        levelId : ElementId * 
        height : float * 
        offset : float * 
        flip : bool * 
        structural : bool -> Wall 

Parameters

document  Document
The document in which the new wall is created.
curve  Curve
A curve representing the base line of the wall.
wallTypeId  ElementId
Id of the wall type to be used by the new wall instead of the default type.
levelId  ElementId
Id of the level on which the wall is to be placed.
height  Double
The height of the wall other than the default height.
offset  Double
Modifies the wall's Base Offset parameter to determine its vertical placement.
flip  Boolean
Change which side of the wall is considered to be the inside and outside of the wall.
structural  Boolean
If set, specifies that the wall is structural in nature.

Return Value

Wall
If successful a new wall object within the project.
Exceptions
ExceptionCondition
ArgumentException The curve argument is not valid for wall creation.
ArgumentNullException A non-optional argument was null
ArgumentOutOfRangeException The given value for height must be greater than 0 and no more than 30000 feet. -or- The given value for offset must be no more than 30000 feet in absolute value.
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.
ModificationOutsideTransactionException The document has no open transaction.
Example
public Wall CreateWallUsingCurve2(Autodesk.Revit.DB.Document document, Level level, WallType wallType)
{
    // 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);

    // Determine the other parameters
    double height = 15;
    double offset = 3;

    // Create a wall using the location line and wall type
    return Wall.Create(document, geomLine, wallType.Id, level.Id, height, offset, true, true);
}
Public Function CreateWallUsingCurve2(document As Autodesk.Revit.DB.Document, level As Level, wallType As WallType) 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])

    ' Determine the other parameters
    Dim height As Double = 15
    Dim offset As Double = 3

    ' Create a wall using the location line and wall type
    Return Wall.Create(document, geomLine, wallType.Id, level.Id, height, offset, _
        True, True)
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