SetLayoutAsCustomPattern Method (Double, Double, IList(FabricWireItem), IList(FabricWireItem))


Sets the minor and major layout patterns as Custom, while specifying the needed parameters for this pattern.

Namespace: Autodesk.Revit.DB.Structure
Assembly: RevitAPI (in RevitAPI.dll) Version: 19.0.0.0 (19.0.0.405)
Since: 2018

Syntax

C#
public void SetLayoutAsCustomPattern(
	double minorStartOverhang,
	double majorStartOverhang,
	IList<FabricWireItem> minorFabricWireItems,
	IList<FabricWireItem> majorFabricWireItems
)
Visual Basic
Public Sub SetLayoutAsCustomPattern ( _
	minorStartOverhang As Double, _
	majorStartOverhang As Double, _
	minorFabricWireItems As IList(Of FabricWireItem), _
	majorFabricWireItems As IList(Of FabricWireItem) _
)
Visual C++
public:
void SetLayoutAsCustomPattern(
	double minorStartOverhang, 
	double majorStartOverhang, 
	IList<FabricWireItem^>^ minorFabricWireItems, 
	IList<FabricWireItem^>^ majorFabricWireItems
)

Parameters

minorStartOverhang
Type: System Double
The distance from the edge of the sheet to the first wire in the minor direction.
majorStartOverhang
Type: System Double
The distance from the edge of the sheet to the first wire in the major direction.
minorFabricWireItems
Type: System.Collections.Generic IList FabricWireItem
The fabric wire items in the minor direction.
majorFabricWireItems
Type: System.Collections.Generic IList FabricWireItem
The fabric wire items in the major direction.

Remarks

The following properties are not used for custom fabric sheet type: - MajorDirectionWireType; - MinorDirectionWireType; - MajorSpacing; - MinorSpacing.

Examples

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

    // Create a new type for custom FabricSheet
    ElementId fabricSheetTypeId = FabricSheetType.CreateDefaultFabricSheetType(document);
    FabricSheetType fst = document.GetElement(fabricSheetTypeId) as FabricSheetType;

    // Create some fabric wire types
    ElementId idWireType1 = FabricWireType.CreateDefaultFabricWireType(document);
    FabricWireType wireType1 = document.GetElement(idWireType1) as FabricWireType;
    wireType1.WireDiameter = 3.5/12.0;

    ElementId idWireType2 = FabricWireType.CreateDefaultFabricWireType(document);
    FabricWireType wireType2 = document.GetElement(idWireType1) as FabricWireType;
    wireType2.WireDiameter = 2.0/12.0;

    // Create the wires for the custom pattern
    IList<FabricWireItem> majorWires = new List<FabricWireItem>();
    IList<FabricWireItem> minorWires = new List<FabricWireItem>();
    FabricWireItem item = FabricWireItem.Create(2.0/12.0, 1, idWireType1, .0);
    majorWires.Add(item);
    majorWires.Add(item);
    item = FabricWireItem.Create(1.5 / 12.0, 10.0 / 12.0, idWireType2, .0);
    majorWires.Add(item);

    item = FabricWireItem.Create(3.0 / 12.0, 1, idWireType2, .0);
    minorWires.Add(item);
    item = FabricWireItem.Create(3.0 / 12.0, 10.0 / 12.0, idWireType2, .0);
    minorWires.Add(item);

    fst.SetLayoutAsCustomPattern(6.0 / 12.0, 4.0 / 12.0, minorWires, majorWires);

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


    AnalyticalModelSurface ams = wall.GetAnalyticalModel() as AnalyticalModelSurface;
    sheet.PlaceInHost(wall, ams.GetLocalCoordinateSystem());

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

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

      ' Create a new type for custom FabricSheet
      Dim fabricSheetTypeId As ElementId = FabricSheetType.CreateDefaultFabricSheetType(document)
      Dim fst As FabricSheetType = TryCast(document.GetElement(fabricSheetTypeId), FabricSheetType)

      ' Create some fabric wire types
      Dim idWireType1 As ElementId = FabricWireType.CreateDefaultFabricWireType(document)
      Dim wireType1 As FabricWireType = TryCast(document.GetElement(idWireType1), FabricWireType)
      wireType1.WireDiameter = 3.5 / 12.0

      Dim idWireType2 As ElementId = FabricWireType.CreateDefaultFabricWireType(document)
      Dim wireType2 As FabricWireType = TryCast(document.GetElement(idWireType1), FabricWireType)
      wireType2.WireDiameter = 2.0 / 12.0

      ' Create the wires for the custom pattern
      Dim majorWires As IList(Of FabricWireItem) = New List(Of FabricWireItem)()
      Dim minorWires As IList(Of FabricWireItem) = New List(Of FabricWireItem)()
      Dim item As FabricWireItem = FabricWireItem.Create(2.0 / 12.0, 1, idWireType1, .0)
      majorWires.Add(item)
      majorWires.Add(item)
      item = FabricWireItem.Create(1.5 / 12.0, 10.0 / 12.0, idWireType2, .0)
      majorWires.Add(item)

      item = FabricWireItem.Create(3.0 / 12.0, 1, idWireType2, .0)
      minorWires.Add(item)
      item = FabricWireItem.Create(3.0 / 12.0, 10.0 / 12.0, idWireType2, .0)
      minorWires.Add(item)

      fst.SetLayoutAsCustomPattern(6.0 / 12.0, 4.0 / 12.0, minorWires, majorWires)

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


      Dim ams As AnalyticalModelSurface = TryCast(wall.GetAnalyticalModel(), AnalyticalModelSurface)
      sheet.PlaceInHost(wall, ams.GetLocalCoordinateSystem())

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

      Return sheet
  End Function

Exceptions

Exception Condition
Autodesk.Revit.Exceptions ArgumentException The given value for minorStartOverhang is not a number -or- The given value for majorStartOverhang is not a number
Autodesk.Revit.Exceptions ArgumentNullException A non-optional argument was NULL
Autodesk.Revit.Exceptions ArgumentOutOfRangeException The given value for minorStartOverhang must be between 0 and 30000 feet. -or- The given value for majorStartOverhang must be between 0 and 30000 feet.
Autodesk.Revit.Exceptions DisabledDisciplineException None of the following disciplines is enabled: Structural.

See Also