Create Method (Document, ElementId, ElementId, CurveLoop)


Creates a new instance of a single bent Fabric Sheet element within the project.

Namespace: Autodesk.Revit.DB.Structure
Assembly: RevitAPI (in RevitAPI.dll) Version: 17.0.0.0 (17.0.1090.0)
Since: 2016

Syntax

C#
public static FabricSheet Create(
	Document document,
	ElementId concreteHostElementId,
	ElementId fabricSheetTypeId,
	CurveLoop bendProfile
)
Visual Basic
Public Shared Function Create ( _
	document As Document, _
	concreteHostElementId As ElementId, _
	fabricSheetTypeId As ElementId, _
	bendProfile As CurveLoop _
) As FabricSheet
Visual C++
public:
static FabricSheet^ Create(
	Document^ document, 
	ElementId^ concreteHostElementId, 
	ElementId^ fabricSheetTypeId, 
	CurveLoop^ bendProfile
)

Parameters

document
Type: Autodesk.Revit.DB Document
The document in which the fabric sheet is to be created.
concreteHostElementId
Type: Autodesk.Revit.DB ElementId
The element that will host the FabricSheet. The host can be a Structural Floor, Structural Wall, Structural Slab, Structural Floor Edge, Structural Slab Edge, Structural Column, Beam and Brace. Also, host can be a [!:Autodesk::Revit::DB::Part] created from a structural layer of Structural Floor, Structural Wall or Structural Slab.
fabricSheetTypeId
Type: Autodesk.Revit.DB ElementId
The id of the FabricSheetType.
bendProfile
Type: Autodesk.Revit.DB CurveLoop
A profile that defines the bending shape of the fabric sheet. The profile can be provided without fillets (eg. for L shape, only two lines not two lines and one arc), if so, then fillets (in example one arc) will be automatically generated basing on the Bend Diameter parameter defined in the Fabric Wire system family. If the provided profile has no corners (has a tangent defined at each point except the ends), no fillets will be generated. The provided profile defines the center-curve of a wire.

Return Value

The instance of the newly created bent fabric sheet.

Examples

Copy C#
private FabricSheet CreateBentFabricSheet(Document document, Element column)
{
    if (FabricSheet.IsValidHost(column) == false)
        return null;

    CurveLoop bendingProfile = new CurveLoop();
    Line line1 = Line.CreateBound(new XYZ(1, 0.8, 0), new XYZ(2, 0.8, 0));
    Line line2 = Line.CreateBound(new XYZ(2, -0.8, 0), new XYZ(4, -2, 0));
    Arc arc = Arc.Create(line1.GetEndPoint(1), line2.GetEndPoint(0), new XYZ(3, 0, 0));
    bendingProfile.Append(line1);
    bendingProfile.Append(arc);
    bendingProfile.Append(line2);

    ElementId fabricSheetTypeId = document.GetDefaultElementTypeId(ElementTypeGroup.FabricSheetType);
    //FabricSheetType fst = document.GetElement(fabricSheetTypeId) as FabricSheetType;
    //fst.SetMajorLayoutAsFixedNumber(0.8, .08, 0.08, 4);
    //fst.SetMinorLayoutAsMaximumSpacing(0.6, .02, .04, .25);

    FabricSheet bentFabricSheet = FabricSheet.Create(document, column.Id, fabricSheetTypeId, bendingProfile);
    // Regeneration is required before setting any property to object that was created in the same transaction.
    document.Regenerate();

    bentFabricSheet.BentFabricBendDirection = BentFabricBendDirection.Major;

    AnalyticalModelColumn amc = column.GetAnalyticalModel() as AnalyticalModelColumn;
    bentFabricSheet.PlaceInHost(column, amc.GetLocalCoordinateSystem());

    // Give the user some information
    TaskDialog.Show("Revit", string.Format("Bent Fabric Sheet ID='{0}' created successfully.", bentFabricSheet.Id.IntegerValue));

    return bentFabricSheet;
}
Copy VB.NET
Private Function CreateBentFabricSheet(document As Document, column As Element) As FabricSheet
    If FabricSheet.IsValidHost(column) = False Then
        Return Nothing
    End If

    Dim bendingProfile As New CurveLoop()
    Dim line1 As Line = Line.CreateBound(New XYZ(1, 0.8, 0), New XYZ(2, 0.8, 0))
    Dim line2 As Line = Line.CreateBound(New XYZ(2, -0.8, 0), New XYZ(4, -2, 0))
    Dim arc__1 As Arc = Arc.Create(line1.GetEndPoint(1), line2.GetEndPoint(0), New XYZ(3, 0, 0))
    bendingProfile.Append(line1)
    bendingProfile.Append(arc__1)
    bendingProfile.Append(line2)

    Dim fabricSheetTypeId As ElementId = document.GetDefaultElementTypeId(ElementTypeGroup.FabricSheetType)
    'FabricSheetType fst = document.GetElement(fabricSheetTypeId) as FabricSheetType;
    'fst.SetMajorLayoutAsFixedNumber(0.8, .08, 0.08, 4);
    'fst.SetMinorLayoutAsMaximumSpacing(0.6, .02, .04, .25);


    Dim bentFabricSheet As FabricSheet = FabricSheet.Create(document, column.Id, fabricSheetTypeId, bendingProfile)
    ' Regeneration is required before setting any property to object that was created in the same transaction.
    document.Regenerate()

    bentFabricSheet.BentFabricBendDirection = BentFabricBendDirection.Major

    Dim amc As AnalyticalModelColumn = TryCast(column.GetAnalyticalModel(), AnalyticalModelColumn)
    bentFabricSheet.PlaceInHost(column, amc.GetLocalCoordinateSystem())

    ' Give the user some information
    TaskDialog.Show("Revit", String.Format("Bent Fabric Sheet ID='{0}' created successfully.", bentFabricSheet.Id.IntegerValue))

    Return bentFabricSheet
End Function

Exceptions

Exception Condition
Autodesk.Revit.Exceptions ArgumentException concreteHostElementId is not a valid ElementId for the host Fabric Sheet. -or- fabricSheetTypeId should refer to an FabricSheetType element. -or- Thrown when the bend profile contains an overlap or intersecting segments. -or- Thrown when the bend profile is empty. -or- Thrown when the bend profile contains an empty loop. -or- Thrown when the bend profile contains multiple loops. -or- Thrown when the bend profile contains a closed loop. -or- Thrown when the bend profile contains two or more arcs that are not separated from one another by a straight segment. -or- Thrown when the bend profile contains too short segments which prevent the fillets from being added. The fillet radius is taken from Bend Diameter parameter defined in the Fabric Wire system family. -or- Thrown when the provided profile cannot be used as a bending shape for this fabric sheet.
Autodesk.Revit.Exceptions ArgumentNullException A non-optional argument was NULL
Autodesk.Revit.Exceptions DisabledDisciplineException None of the following disciplines is enabled: Structural.

See Also