Create Method (Document, ElementId, ElementId, CurveLoop)


Fabric Sheet Create(Document, Element Id, Element Id, Curve Loop) Method

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: 25.0.0.0 (25.0.0.0)
Syntax
public static FabricSheet Create(
	Document document,
	ElementId concreteHostElementId,
	ElementId fabricSheetTypeId,
	CurveLoop bendProfile
)

Parameters

document Document
The document in which the fabric sheet is to be created.
concreteHostElementId 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 ElementId
The id of the FabricSheetType.
bendProfile 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

FabricSheet
The instance of the newly created bent fabric sheet.
Exceptions
Exception Condition
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.
ArgumentNullException A non-optional argument was null
Example
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;

   FamilyInstance famInstColumn = column as FamilyInstance;
   if (famInstColumn != null)
   {
      bentFabricSheet.PlaceInHost(column, famInstColumn.GetTransform());
   }

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

   return bentFabricSheet;
}
See Also