Rebar Create |
Creates a new shape driven Rebar, as an instance of a RebarShape. The instance will have the default shape parameters from the RebarShape, and its location is based on the bounding box of the shape in the shape definition. Hooks are removed from the shape before computing its bounding box. If appropriate hooks can be found in the document, they will be assigned arbitrarily.
Namespace: Autodesk.Revit.DB.Structure
Assembly: RevitAPI (in RevitAPI.dll) Version: 25.3.0.0 (25.3.0.0)

public static Rebar CreateFromRebarShape(
Document doc,
RebarShape rebarShape,
RebarBarType barType,
Element host,
XYZ origin,
XYZ xVec,
XYZ yVec
)
Parameters
- doc Document
- A document.
- rebarShape RebarShape
- A RebarShape element that defines the shape of the rebar.
- barType RebarBarType
- A RebarBarType element that defines bar diameter, bend radius and material of the rebar.
- host Element
- The element to which the rebar belongs. The element must support rebar hosting; [!:Autodesk::Revit::DB::Structure::RebarHostData] .
- origin XYZ
- The lower-left corner of the shape's bounding box will be placed at this point in the project.
- xVec XYZ
- The x-axis in the shape definition will be mapped to this direction in the project.
- yVec XYZ
- The y-axis in the shape definition will be mapped to this direction in the project.
Return Value
RebarThe newly created Rebar instance, or if the operation fails.

Exception | Condition |
---|---|
ArgumentException | The element host was not found in the given document. -or- host is not a valid rebar host. |
ArgumentNullException | A non-optional argument was null |
ArgumentOutOfRangeException | xVec has zero length. -or- yVec has zero length. |
