GetShapeId Method


Rebar Get Shape Id Method

Returns the id of the RebarShape element that defines the shape of the rebar.

Namespace: Autodesk.Revit.DB.Structure
Assembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)
Syntax
public ElementId GetShapeId()

Return Value

ElementId
Exceptions
Exception Condition
InvalidOperationException This Rebar is matched with multiple shapes.
Remarks

A Free Form Rebar that has Workshop Instructions set to Bent is considered to have multiple shapes and this method will throw exception.

A Free Form Rebar that has Workshop Instructions set to Straight or a Shape Driven is considered to have only one shape and this method will return the id of that shape.

See Also
ArchiLabs

Stop fighting Revit automation.

Build repeatable BIM design and documentation workflows with scripts, data, and AI in one place, without wrestling brittle one-off automations.

Try ArchiLabs →