The Autodesk.Revit.DB.Structure.RebarShapeSegmentEndReferenceType
enumeration provides a list of possible rebar segment end reference types in a rebar shape definition.
The following enumerations are available:
Start
- The reference is at the start of a rebar segment.End
- The reference is at the end of a rebar segment.StartOrEnd
- The reference is at either the start or the end of a rebar segment.This enumeration is used when defining a rebar shape definition in a Revit project. It is used to specify the reference point of a rebar segment in relation to other rebar segments or the base plane.
// Create a new rebar shape definition
RebarShapeDefinition rebarShapeDefinition = new RebarShapeDefinition();
// Add a rebar segment to the shape definition
RebarShapeSegment segment = rebarShapeDefinition.AddSegment();
segment.Shape = RebarShapeSegmentType.Straight;
segment.ReferenceType = RebarShapeSegmentEndReferenceType.Start;
// Set the shape definition to a rebar element
Rebar rebar = Rebar.CreateFromRebarShape(doc, rebarShapeDefinition, defaultRebarType, null, null, null);
In the example above, a new rebar shape definition is created, and a new rebar segment is added to it. The reference type of the segment is set to Start
, indicating that the segment is located at the start of the rebar.