Revit 2025 API
Export |
A value used to represent the info stored in the ExportLayerTable.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)
Syntax
The ExportLayerInfo type exposes the following members.

Name | Description | |
---|---|---|
![]() | ExportLayerInfo | Constructs a new ExportLayerInfo with default values. |

Name | Description | |
---|---|---|
![]() | CategoryType | The category type which this layer belongs to. |
![]() | ColorName | The color name stored in value. For IFC export, the naming is to match the "colornumber" setting -- really, this stores a string that generates the colorNumber (for formats that don't use the color but need a second entry.) |
![]() | ColorNumber | The color number stored in value. |
![]() | CutColorNumber | The cut color number stored in value. |
![]() | CutLayerName | The cut layer name stored in value. |
![]() | IsValidObject | Specifies whether the .NET object represents a valid Revit entity. |
![]() | LayerName | The layer name stored in value. |

Name | Description | |
---|---|---|
![]() | AddCutLayerModifier | Adds a cut layer modifier to the layer info. |
![]() | AddLayerModifier | Adds a project layer modifier to the layer info. |
![]() | ClearCutLayerModifiers | Clears all the cut layer modifiers stored in the layer info. |
![]() | ClearLayerModifiers | Clears all the project layer modifiers stored in the layer info. |
![]() | Dispose | Releases all resources used by the ExportLayerInfo |
![]() | Equals | Determines whether the specified object is equal to the current object. (Inherited from Object) |
![]() | GetCutLayerModifiers | Gets all the cut layer modifiers from the layer info. |
![]() | GetHashCode | Serves as the default hash function. (Inherited from Object) |
![]() | GetLayerModifiers | Gets all the project layer modifiers from the layer info. |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object) |
![]() | RemoveCutLayerModifier | Removes a cut layer modifier from the layer info. |
![]() | RemoveLayerModifier | Removes a project layer modifier from the layer info. |
![]() | SetCutLayerModifiers | Sets a cut layer modifier array to the layer info. |
![]() | SetLayerModifiers | Sets a project layer modifier array to the layer info. |
![]() | ToString | Returns a string that represents the current object. (Inherited from Object) |

public bool ExportDWGModifyLayerTable(Document document, View view) { bool exported = false; IList<string> setupNames = BaseExportOptions.GetPredefinedSetupNames(document); if (setupNames.Count > 0) { // Get the export options for the first predefined setup DWGExportOptions dwgOptions = DWGExportOptions.GetPredefinedOptions(document, setupNames[0]); // Get the export layer table ExportLayerTable layerTable = dwgOptions.GetExportLayerTable(); // Find the first mapping for the Ceilings category string category = "Ceilings"; ExportLayerKey targetKey = layerTable.GetKeys().First<ExportLayerKey>(layerKey => layerKey.CategoryName == category); ExportLayerInfo targetInfo = layerTable[targetKey]; // change the color name and cut color number for this mapping targetInfo.ColorName = "31"; targetInfo.CutColorNumber = 31; // Set the change back to the map layerTable[targetKey] = targetInfo; // Set the modified table back to the options dwgOptions.SetExportLayerTable(layerTable); ICollection<ElementId> views = new List<ElementId>(); views.Add(view.Id); exported = document.Export(Path.GetDirectoryName(document.PathName), Path.GetFileNameWithoutExtension(document.PathName), views, dwgOptions); } return exported; }
Public Function ExportDWGModifyLayerTable(document As Document, view As View) As Boolean Dim exported As Boolean = False Dim setupNames As IList(Of String) = BaseExportOptions.GetPredefinedSetupNames(document) If setupNames.Count > 0 Then ' Get the export options for the first predefined setup Dim dwgOptions As DWGExportOptions = DWGExportOptions.GetPredefinedOptions(document, setupNames(0)) ' Get the export layer table Dim layerTable As ExportLayerTable = dwgOptions.GetExportLayerTable() ' Find the first mapping for the Ceilings category Dim category As String = "Ceilings" Dim targetKey As ExportLayerKey = layerTable.GetKeys().First(Function(layerKey) layerKey.CategoryName = category) Dim targetInfo As ExportLayerInfo = layerTable(targetKey) ' change the color name and cut color number for this mapping targetInfo.ColorName = "31" targetInfo.CutColorNumber = 31 ' Set the change back to the map layerTable(targetKey) = targetInfo ' Set the modified table back to the options dwgOptions.SetExportLayerTable(layerTable) Dim views As ICollection(Of ElementId) = New List(Of ElementId)() views.Add(view.Id) exported = document.Export(Path.GetDirectoryName(document.PathName), Path.GetFileNameWithoutExtension(document.PathName), views, dwgOptions) End If Return exported 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