2021 Method
Changes 0
M

RebarContainer.Create

Description:
Creates a new instance of a Rebar Container element within the project.
Remarks:
Created Rebar Container starts out empty. Use appendItemFromRebar, appendItemFromCurves, appendItemFromRebarShape, appendItemFromCurvesAndShape to fill its content.
public static RebarContainer Create(
	Document aDoc,
	Element hostElement,
	ElementId rebarContainerTypeId
)
Return Value RebarContainer The newly created Rebar Container instance.
RebarContainer CreateRebarContainer(Autodesk.Revit.DB.Document document, FamilyInstance beam)
{
    // Create a new rebar container
    ElementId defaultRebarContainerTypeId = RebarContainerType.CreateDefaultRebarContainerType(document);
    RebarContainer container = RebarContainer.Create(document, beam, defaultRebarContainerTypeId);

    // Any items for this container should be presented in schedules and tags as separate subelements
    container.PresentItemsAsSubelements = true;

    return container;
}