Autodesk.Revit.DB.ExportLayerKey是Revit API中的一个类,它表示图层的键值对。
public class ExportLayerKey : IEquatable<ExportLayerKey>
Autodesk.Revit.DB.ExportLayerKey具有以下属性:
Autodesk.Revit.DB.ExportLayerKey具有以下方法:
// 获取文档对象
Document doc = Application.ActiveDocument;
// 获取导出选项对象
ExportOptions options = new ExportOptions();
// 设置导出选项
options.ExportScope = ExportScope.View;
options.FileType = ExportFileType.DWG;
options.ExportLayers = true;
// 获取图层键值对
ExportLayerKeyValue[] keyValuePairs = options.GetExportLayerKeyValuePairs();
foreach (ExportLayerKeyValue keyValuePair in keyValuePairs)
{
ExportLayerKey layerKey = keyValuePair.LayerKey;
Console.WriteLine($"LayerName: {layerKey.LayerName} Color: {layerKey.Color}");
}