Skip to content

ExportLayerInfo

Public Class

A value used to represent the info stored in the ExportLayerTable.

Inheritance Hierarchy

System.Object
Autodesk.Revit.DB.ExportLayerInfo

Namespace: Autodesk.Revit.DB

Assembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)

Syntax

public class ExportLayerInfo : IDisposable

The ExportLayerInfo type exposes the following members.

Constructors

Name

Description


Public Method
ExportLayerInfo

Constructs a new ExportLayerInfo with default values.


Properties

Name

Description


Public Property

The category type which this layer belongs to.


Public Property

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.)


Public Property

The color number stored in value.


Public Property

The cut color number stored in value.


Public Property

The cut layer name stored in value.


Public Property
IsValidObject

Specifies whether the .NET object represents a valid Revit entity.


Public Property

The layer name stored in value.


Methods

Name

Description


Public Method

Adds a cut layer modifier to the layer info.


Public Method

Adds a project layer modifier to the layer info.


Public Method

Clears all the cut layer modifiers stored in the layer info.


Public Method

Clears all the project layer modifiers stored in the layer info.


Public Method

Releases all resources used by the ExportLayerInfo


Public Method

Equals

Determines whether the specified object is equal to the current object.
(Inherited from Object)


Public Method

Gets all the cut layer modifiers from the layer info.


Public Method

GetHashCode

Serves as the default hash function.
(Inherited from Object)


Public Method

Gets all the project layer modifiers from the layer info.


Public Method

GetType

Gets the Type of the current instance.
(Inherited from Object)


Public Method

Removes a cut layer modifier from the layer info.


Public Method

Removes a project layer modifier from the layer info.


Public Method

Sets a cut layer modifier array to the layer info.


Public Method

Sets a project layer modifier array to the layer info.


Public Method

ToString

Returns a string that represents the current object.
(Inherited from Object)


Example

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;
}