Share

Rebar.CreateFromCurvesAndShape(Document, RebarShape, RebarBarType, Element, XYZ, IList<Curve>, BarTerminationsData) Method

Creates a new instance of a shape driven Rebar element within the project. The instance will have the default shape parameters from the RebarShape. The curves and terminations data should match the rebar shape definition. If the RebarShapeDefinesHooks flag in ReinforcementSettings has been set to false, the hooks and their rotation angles can be different than the defaults specified in the RebarShape. If the RebarShapeDefinesEndTreatment flag in ReinforcementSettings has been set to false, the end treatments can be different than the defaults specified in the RebarShape.


Namespace: Autodesk.Revit.DB.Structure
Assembly: RevitAPI (in RevitAPI.dll) Version: 26.1.0.0 (26.1.0.34)

Syntax

C#

public static Rebar CreateFromCurvesAndShape(
	Document doc,
	RebarShape rebarShape,
	RebarBarType barType,
	Element host,
	XYZ norm,
	IList<Curve> curves,
	BarTerminationsData barTerminationsData
)

Parameters

doc  Document
A document.
rebarShape  RebarShape
A RebarShape element that defines the shape of the rebar. A RebarShape element that matches curves, and terminations data. A RebarShape element that provides the RebarStyle 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. See # [!:Autodesk::Revit::DB::Structure::RebarHostData].
norm  XYZ
The normal to the plane that the rebar curves lie on.
curves  IList<Curve>
An array of curves that define the shape of the rebar curves. They must belong to the plane defined by the normal and origin. Bends, hooks and cranks should not be included in the array of curves.
barTerminationsData  BarTerminationsData
Data about the Rebar's terminations.

Return Value

Rebar
The newly created Rebar instance, or nullptr if the operation fails.

Exceptions

ExceptionCondition
ArgumentException The element host was not found in the given document. -or- host is not a valid rebar host. -or- The input curves is empty. -or- The input curves contains at least one curve which is not a bound Line or bound Arc and is not supported for this operation. -or- curves do not form a valid CurveLoop. -or- The input curves contains at least one helical curve and is not supported for this operation. -or- The barTerminationsData was not created using the input document. -or- The barTerminationsData was not created using the rebarShape's document. -or- The barTerminationsData was not created using the barType's document. -or- The input curves are too small to apply crank on them.
ArgumentNullException A non-optional argument was null
ArgumentOutOfRangeException norm has zero length.
ArgumentsInconsistentException curves contains non-fillet arcs with radii that are less than the minimum bend radius for the RebarBarType and RebarShape style.
InvalidOperationException rebarShape does not match curves.

See Also

Reference

Was this information helpful?