Wall.Create
Description:
Creates a new rectangular profile wall within the project using the specified wall type, height, and offset.
Creates a new rectangular profile wall within the project using the specified wall type, height, and offset.
Overloads (5):
Create(Document,Curve,ElementId,ElementId,Double,Double,Boolean,Boolean)
-
documentThe document in which the new wall is created.
-
curveA curve representing the base line of the wall.
-
wallTypeIdId of the wall type to be used by the new wall instead of the default type.
-
levelIdId of the level on which the wall is to be placed.
-
DoubleheightThe height of the wall other than the default height.
-
DoubleoffsetModifies the wall's Base Offset parameter to determine its vertical placement.
-
BooleanflipChange which side of the wall is considered to be the inside and outside of the wall.
-
BooleanstructuralIf set, specifies that the wall is structural in nature.
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);
}
-
The curve argument is not valid for wall creation.
-
A non-optional argument was null
-
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.
-
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.
-
The document has no open transaction.