Indicates the index of the layer which is designated as variable.
Namespace: Autodesk.Revit.DBAssembly: RevitAPI (in RevitAPI.dll) Version: 21.0.0.0 (21.1.1.109)
Syntax
C# |
---|
public int VariableLayerIndex { get; set; } |
Visual Basic |
---|
Public Property VariableLayerIndex As Integer Get Set |
Visual C++ |
---|
public: property int VariableLayerIndex { int get (); void set (int value); } |
Field Value
The index of the layer specified as variable. If there is no variable layer, this value is -1.
Remarks
If the host object to which it is applied
has an actual width that exceeds the total width of all layers, then all layers except the variable layer
will be created with their specified width, and the variable layer will expand to take up the slack.
Generally this is applicable for floors and roofs with shape edits applied. There can be only one variable layer.
In the wall compound structure UI, when a layer is labeled 'variable' in the thickness column,
that means it is assigned either to a non-rectangular region, or it means the layer is assigned to two different layers.
Neither of those situations is what this method refers to.
Exceptions
Exception | Condition |
---|---|
Autodesk.Revit.Exceptions..::..ArgumentException | When setting this property: The specified layer cannot be set to a variable layer. |
Autodesk.Revit.Exceptions..::..ArgumentOutOfRangeException | When setting this property: The layer index is invalid. |