CreateFreeForm Method (Document, RebarBarType, Element, IList(CurveLoop), RebarFreeFormValidationResult)


Creates a free form rebar that will be unconstrained. Constraints can't be added later to this rebar.

Namespace: Autodesk.Revit.DB.Structure
Assembly: RevitAPI (in RevitAPI.dll) Version: 18.0.0.0 (18.2.0.0)
Since: 2018

Syntax

C#
public static Rebar CreateFreeForm(
	Document doc,
	RebarBarType barType,
	Element host,
	IList<CurveLoop> curves,
	out RebarFreeFormValidationResult error
)
Visual Basic
Public Shared Function CreateFreeForm ( _
	doc As Document, _
	barType As RebarBarType, _
	host As Element, _
	curves As IList(Of CurveLoop), _
	<OutAttribute> ByRef error As RebarFreeFormValidationResult _
) As Rebar
Visual C++
public:
static Rebar^ CreateFreeForm(
	Document^ doc, 
	RebarBarType^ barType, 
	Element^ host, 
	IList<CurveLoop^>^ curves, 
	[OutAttribute] RebarFreeFormValidationResult% error
)

Parameters

doc
Type: Autodesk.Revit.DB Document
A document.
barType
Type: Autodesk.Revit.DB.Structure RebarBarType
A RebarBarType element that defines bar diameter, bend radius and material of the rebar.
host
Type: Autodesk.Revit.DB Element
The element to which the rebar belongs. The element must support rebar hosting.
curves
Type: System.Collections.Generic IList CurveLoop
Each curve loop represents a bar in the set.
error
Type: Autodesk.Revit.DB.Structure RebarFreeFormValidationResult %
Will be Success(0) if everything is ok, otherwise the failure reason.

Return Value

The newly created free form Rebar Instance.

Remarks

This function can fail due to following reasons:

  • The array of CurveLoops is empty.
  • At least one CurveLoop is empty.
  • At least one CurveLoop contains an unbounded curve.
  • A rebar constructed from curves can't be bent according to the bending radius.

Exceptions

Exception Condition
Autodesk.Revit.Exceptions ArgumentException host is not a valid rebar host.
Autodesk.Revit.Exceptions ArgumentNullException A non-optional argument was NULL
Autodesk.Revit.Exceptions ArgumentOutOfRangeException A value passed for an enumeration argument is not a member of that enumeration
Autodesk.Revit.Exceptions DisabledDisciplineException None of the following disciplines is enabled: Structural.

See Also

ArchiLabs Desktop

Put AI to work inside Revit.

Give Desktop your instructions and project files to build Revit families, update model elements, and create views and schedules. Works directly in Revit and AutoCAD.

Explore Desktop →