FabricAreaCreate(Document, Element, XYZ, ElementId, ElementId) Method |
Creates a FabricArea based on a host boundary.
Namespace: Autodesk.Revit.DB.StructureAssembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)
Syntaxpublic static FabricArea Create(
Document aDoc,
Element hostElement,
XYZ majorDirection,
ElementId fabricAreaTypeId,
ElementId fabricSheetTypeId
)
Public Shared Function Create (
aDoc As Document,
hostElement As Element,
majorDirection As XYZ,
fabricAreaTypeId As ElementId,
fabricSheetTypeId As ElementId
) As FabricArea
public:
static FabricArea^ Create(
Document^ aDoc,
Element^ hostElement,
XYZ^ majorDirection,
ElementId^ fabricAreaTypeId,
ElementId^ fabricSheetTypeId
)
static member Create :
aDoc : Document *
hostElement : Element *
majorDirection : XYZ *
fabricAreaTypeId : ElementId *
fabricSheetTypeId : ElementId -> FabricArea
Parameters
- aDoc Document
-
The document.
- hostElement Element
-
The element that will host the FabricArea. The host can be a Structural Floor, Structural Wall, Structural Slab, or a Part created from a structural layer belonging to one of those element types.
- majorDirection XYZ
-
A vector to define the major direction of the FabricArea.
- fabricAreaTypeId ElementId
-
The id of the FabricAreaType.
- fabricSheetTypeId ElementId
-
The id of the FabricSheetType.
Return Value
FabricArea
The newly created FabricArea.
ExceptionsException | Condition |
---|
ArgumentException |
The element hostElement was not found in the given document.
-or-
the host Element is not a valid host for Area Reinforcement, Path Reinforcement, Fabric Area or Fabric Sheet.
-or-
fabricAreaTypeId should refer to an FabricAreaType element.
-or-
fabricSheetTypeId should refer to an FabricSheetType element.
|
ArgumentNullException |
A non-optional argument was null
|
ArgumentOutOfRangeException |
majorDirection has zero length.
|
Exampleprivate FabricArea CreateNewFabricArea(Document document, Element wall)
{
FabricArea system = null;
ElementId fabricAreaTypeId = FabricAreaType.CreateDefaultFabricAreaType(document);
ElementId fabricSheetTypeId = FabricSheetType.CreateDefaultFabricSheetType(document);
system = FabricArea.Create(document, wall, new XYZ(1, 0, 0), fabricAreaTypeId, fabricSheetTypeId);
document.Regenerate();
IList<ElementId> sheetIds = system.GetFabricSheetElementIds();
TaskDialog.Show("Revit", string.Format("{0} fabric sheets created", sheetIds.Count));
return system;
}
Private Function CreateNewFabricArea(document As Document, wall As Element) As FabricArea
Dim system As FabricArea = Nothing
Dim fabricAreaTypeId As ElementId = FabricAreaType.CreateDefaultFabricAreaType(document)
Dim fabricSheetTypeId As ElementId = FabricSheetType.CreateDefaultFabricSheetType(document)
system = FabricArea.Create(document, wall, New XYZ(1, 0, 0), fabricAreaTypeId, fabricSheetTypeId)
document.Regenerate()
Dim sheetIds As IList(Of ElementId) = system.GetFabricSheetElementIds()
TaskDialog.Show("Revit", String.Format("{0} fabric sheets created", sheetIds.Count))
Return system
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