How do I identify if a layer is hidden/invisible or not? I have written a small piece of code below using the Aspose.CAD nuget package in C# .NET - It iterates through the layers of the CAD Image and provides some basic info (the LogIt function just writes the string output - kinda similar to console output).
It’s useful, but I would like to be able to do two things:
Tell if a layer is visible/hidden
Hide/Un-Hide a layer
I am not in control of the source .DWG file and I need to perform some actions based on whether the layer is hidden or not - Is there any way to achieve this?
using (Aspose.CAD.Image image = Aspose.CAD.Image.Load(selectFile.FileName))
{
Aspose.CAD.FileFormats.Cad.CadImage cadImage = (Aspose.CAD.FileFormats.Cad.CadImage)image;
Aspose.CAD.FileFormats.Cad.CadLayersList layers = cadImage.Layers;
foreach(CadLayerTable Layer in layers)
{
LogIt("Layer Name: " + Layer.Name);
LogIt("Color ID: " + Layer.ColorId.ToString());
LogIt("Plot Flag Has Value: " + Layer.PlotFlag.HasValue.ToString());
LogIt("Plot Flag Value: " + Layer.PlotFlag.ToString());
LogIt("\n");
}
}