2027 Class
Changes 0
C

ExportLayerInfo

Description:
A value used to represent the info stored in the .
Inheritance Hierarchy:
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 Inherited From
C ExportLayerInfo() None Constructs a new ExportLayerInfo with default values.
Name Return Type Description Inherited From
M AddCutLayerModifier(LayerModifier) None Adds a cut layer modifier to the layer info.
M AddLayerModifier(LayerModifier) None Adds a project layer modifier to the layer info.
M ClearCutLayerModifiers() None Clears all the cut layer modifiers stored in the layer info.
M ClearLayerModifiers() None Clears all the project layer modifiers stored in the layer info.
M Dispose() None Releases all resources used by the ExportLayerInfo
M Equals None Determines whether the specified object is equal to the current object. (Inherited from Object ) Object
M GetCutLayerModifiers() IList<LayerModifier> Gets all the cut layer modifiers from the layer info.
M GetHashCode None Serves as the default hash function. (Inherited from Object ) Object
M GetLayerModifiers() IList<LayerModifier> Gets all the project layer modifiers from the layer info.
M GetType None Gets the Type of the current instance. (Inherited from Object ) Object
M RemoveCutLayerModifier(LayerModifier) None Removes a cut layer modifier from the layer info.
M RemoveLayerModifier(LayerModifier) None Removes a project layer modifier from the layer info.
M SetCutLayerModifiers(IList<LayerModifier>) None Sets a cut layer modifier array to the layer info.
M SetLayerModifiers(IList<LayerModifier>) None Sets a project layer modifier array to the layer info.
M ToString None Returns a string that represents the current object. (Inherited from Object ) Object
Name Return Type Description Inherited From
P CategoryType LayerCategoryType The category type which this layer belongs to.
P 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.)
P ColorNumber int The color number stored in value.
P CutColorNumber int The cut color number stored in value.
P CutLayerName string The cut layer name stored in value.
P IsValidObject Boolean Specifies whether the .NET object represents a valid Revit entity.
P LayerName string The layer name stored in value.