RebarCreateFromCurvesAndShape(Document, RebarShape, RebarBarType, RebarHookType, RebarHookType, Element, XYZ, IListCurve, RebarHookOrientation, RebarHookOrientation, Double, Double, ElementId, ElementId) 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.
If the RebarShapeDefinesHooks flag in ReinforcementSettings has been set to true,
then curves, hook types and hook rotation angles should match the rebar shape definition.
Otherwise, the hooks can be different than the defaults specified in the RebarShape.
If the RebarShapeDefinesEndTreatment flag in ReinforcementSettings has been set to true,
then curves and end treatment types should match the rebar shape definition.
Otherwise, the end treatment types can be different than the defaults specified in the RebarShape.
Namespace: Autodesk.Revit.DB.StructureAssembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)
Syntaxpublic static Rebar CreateFromCurvesAndShape(
Document doc,
RebarShape rebarShape,
RebarBarType barType,
RebarHookType startHook,
RebarHookType endHook,
Element host,
XYZ norm,
IList<Curve> curves,
RebarHookOrientation startHookOrient,
RebarHookOrientation endHookOrient,
double hookRotationAngleAtStart,
double hookRotationAngleAtEnd,
ElementId endTreatmentTypeIdAtStart,
ElementId endTreatmentTypeIdAtEnd
)
Public Shared Function CreateFromCurvesAndShape (
doc As Document,
rebarShape As RebarShape,
barType As RebarBarType,
startHook As RebarHookType,
endHook As RebarHookType,
host As Element,
norm As XYZ,
curves As IList(Of Curve),
startHookOrient As RebarHookOrientation,
endHookOrient As RebarHookOrientation,
hookRotationAngleAtStart As Double,
hookRotationAngleAtEnd As Double,
endTreatmentTypeIdAtStart As ElementId,
endTreatmentTypeIdAtEnd As ElementId
) As Rebar
public:
static Rebar^ CreateFromCurvesAndShape(
Document^ doc,
RebarShape^ rebarShape,
RebarBarType^ barType,
RebarHookType^ startHook,
RebarHookType^ endHook,
Element^ host,
XYZ^ norm,
IList<Curve^>^ curves,
RebarHookOrientation startHookOrient,
RebarHookOrientation endHookOrient,
double hookRotationAngleAtStart,
double hookRotationAngleAtEnd,
ElementId^ endTreatmentTypeIdAtStart,
ElementId^ endTreatmentTypeIdAtEnd
)
static member CreateFromCurvesAndShape :
doc : Document *
rebarShape : RebarShape *
barType : RebarBarType *
startHook : RebarHookType *
endHook : RebarHookType *
host : Element *
norm : XYZ *
curves : IList<Curve> *
startHookOrient : RebarHookOrientation *
endHookOrient : RebarHookOrientation *
hookRotationAngleAtStart : float *
hookRotationAngleAtEnd : float *
endTreatmentTypeIdAtStart : ElementId *
endTreatmentTypeIdAtEnd : ElementId -> Rebar
Parameters
- doc Document
-
A document.
- rebarShape RebarShape
-
A RebarShape element that defines the shape of the rebar.
A RebarShape element that matches curves, hooks, hook rotation angles and End Treatment.
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.
- startHook RebarHookType
-
A RebarHookType element that defines the hook for the start of the bar.
If this parameter is , it means to create a rebar with no hook.
- endHook RebarHookType
-
A RebarHookType element that defines the hook for the end of the bar.
If this parameter is , it means to create a rebar with no hook.
- host Element
-
The element to which the rebar belongs. The element must support rebar hosting;
[!:Autodesk::Revit::DB::Structure::RebarHostData].
- norm XYZ
-
The normal to the plane that the rebar curves lie on.
- curves IListCurve
-
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 and hooks should not be included in the array of curves.
- startHookOrient RebarHookOrientation
-
Defines the orientation of the hook plane at the start of the rebar with respect to the orientation of the first curve and the plane normal.
Only two values are permitted:
Value = Right: The hook is on your right as you stand at the end of the bar,
with the bar behind you, taking the bar's normal as "up."
Value = Left: The hook is on your left as you stand at the end of the bar,
with the bar behind you, taking the bar's normal as "up."
- endHookOrient RebarHookOrientation
-
Defines the orientation of the hook plane at the end of the rebar with respect to the orientation of the last curve and the plane normal.
Only two values are permitted:
Value = Right: The hook is on your right as you stand at the end of the bar,
with the bar behind you, taking the bar's normal as "up."
Value = Left: The hook is on your left as you stand at the end of the bar,
with the bar behind you, taking the bar's normal as "up."
- hookRotationAngleAtStart Double
-
The out of plane hook rotation angle at the start of the bar.
- hookRotationAngleAtEnd Double
-
The out of plane hook rotation angle at the end of the bar.
- endTreatmentTypeIdAtStart ElementId
-
The end treatment type id at the start of the bar.
- endTreatmentTypeIdAtEnd ElementId
-
The end treatment type id at the end of the bar.
Return Value
Rebar
The newly created Rebar instance, or
if the operation fails.
ExceptionsException | Condition |
---|
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 parameter endTreatmentTypeIdAtStart is not an EndTreatmentType element.
-or-
the parameter endTreatmentTypeIdAtEnd is not an EndTreatmentType element.
|
ArgumentNullException |
A non-optional argument was null
|
ArgumentOutOfRangeException |
norm has zero length.
-or-
A value passed for an enumeration argument is not a member of that enumeration
|
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