RVTDocs.com
Namespace: Autodesk.Revit.DB Class: Wall

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

Method
Description:
Creates a new rectangular profile wall within the project using the default wall style.
Syntax
public static Wall Create(
	Document document,
	Curve curve,
	ElementId levelId,
	bool structural
)
Examples
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);
}
Parameters
Parameter Type Description
document Document The document in which the new wall is created.
curve Curve A curve representing the base line of the wall.
levelId ElementId Id of the level on which the wall is to be placed.
structural Boolean If set, specifies that the wall is structural in nature.
Return Value
Type Description
Wall If successful a new wall object within the project.
Exceptions
Exception Condition
ArgumentException The curve argument is not valid for wall creation.
ArgumentNullException A non-optional argument was null
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.