ExportLayerInfo
Description:
A value used to represent the info stored in the .
A value used to represent the info stored in the .
Inheritance Hierarchy:
System.Object
Autodesk.Revit.DB.ExportLayerInfo
System.Object
Autodesk.Revit.DB.ExportLayerInfo
public class ExportLayerInfo : IDisposable
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;
}
| Name | Return Type | Description |
|---|---|---|
| ExportLayerInfo() | None | Constructs a new ExportLayerInfo with default values. |
| Name | Return Type | Description |
|---|---|---|
| AddCutLayerModifier(LayerModifier) | None | Adds a cut layer modifier to the layer info. |
| AddLayerModifier(LayerModifier) | None | Adds a project layer modifier to the layer info. |
| ClearCutLayerModifiers() | None | Clears all the cut layer modifiers stored in the layer info. |
| ClearLayerModifiers() | None | Clears all the project layer modifiers stored in the layer info. |
| Dispose() | None | Releases all resources used by the |
| GetCutLayerModifiers() | IList<LayerModifier> | Gets all the cut layer modifiers from the layer info. |
| GetLayerModifiers() | IList<LayerModifier> | Gets all the project layer modifiers from the layer info. |
| RemoveCutLayerModifier(LayerModifier) | None | Removes a cut layer modifier from the layer info. |
| RemoveLayerModifier(LayerModifier) | None | Removes a project layer modifier from the layer info. |
| SetCutLayerModifiers(IList<LayerModifier>) | None | Sets a cut layer modifier array to the layer info. |
| SetLayerModifiers(IList<LayerModifier>) | None | Sets a project layer modifier array to the layer info. |
| Name | Return Type | Description |
|---|---|---|
| CategoryType | LayerCategoryType | The category type which this layer belongs to. |
| ColorName | string | 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 | int | The color number stored in value. |
| CutColorNumber | int | The cut color number stored in value. |
| CutLayerName | string | The cut layer name stored in value. |
| IsValidObject | bool | Specifies whether the .NET object represents a valid Revit entity. |
| LayerName | string | The layer name stored in value. |