RebarContainerCreate Method |
Creates a new instance of a Rebar Container element within the project.
Namespace: Autodesk.Revit.DB.StructureAssembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)
Syntaxpublic static RebarContainer Create(
Document aDoc,
Element hostElement,
ElementId rebarContainerTypeId
)
Public Shared Function Create (
aDoc As Document,
hostElement As Element,
rebarContainerTypeId As ElementId
) As RebarContainer
public:
static RebarContainer^ Create(
Document^ aDoc,
Element^ hostElement,
ElementId^ rebarContainerTypeId
)
static member Create :
aDoc : Document *
hostElement : Element *
rebarContainerTypeId : ElementId -> RebarContainer
Parameters
- aDoc Document
-
A document.
- hostElement Element
-
The element that will host the RebarContainer.
- rebarContainerTypeId ElementId
-
The id of the RebarContainerType.
Return Value
RebarContainer
The newly created Rebar Container instance.
ExceptionsException | Condition |
---|
ArgumentException |
The element hostElement was not found in the given document.
-or-
hostElement is not a valid rebar host.
-or-
the ElementId rebarContainerTypeId is either invalid or not a RebarContainerType.
|
ArgumentNullException |
A non-optional argument was null
|
Remarks
Created Rebar Container starts out empty.
Use appendItemFromRebar, appendItemFromCurves, appendItemFromRebarShape, appendItemFromCurvesAndShape to fill its content.
ExampleRebarContainer CreateRebarContainer(Autodesk.Revit.DB.Document document, FamilyInstance beam)
{
ElementId defaultRebarContainerTypeId = RebarContainerType.CreateDefaultRebarContainerType(document);
RebarContainer container = RebarContainer.Create(document, beam, defaultRebarContainerTypeId);
container.PresentItemsAsSubelements = true;
return container;
}
Private Function CreateRebarContainer(document As Autodesk.Revit.DB.Document, beam As FamilyInstance) As RebarContainer
Dim defaultRebarContainerTypeId As ElementId = RebarContainerType.CreateDefaultRebarContainerType(document)
Dim container As RebarContainer = RebarContainer.Create(document, beam, defaultRebarContainerTypeId)
container.PresentItemsAsSubelements = True
Return container
End Function
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
See Also