iterate over each layer entities c#
Posted: 09 Jun 2021, 17:45
i can access all layers and its properties but the next step is that i need to read all entities in each layer such as lines and texts in a dwg file
can't find such a thing in the documentation, any help please?
here is my code
can't find such a thing in the documentation, any help please?
here is my code
Code: Select all
CADImage vDrawing = CADImage.CreateImageByExtension(filename);
vDrawing.LoadFromFile(filename);
List<string> layerName = new List<string>();
List<bool> layerVisible = new List<bool>();
List<System.Drawing.Color> layerColor = new List<System.Drawing.Color>();
List<bool> layerForzen = new List<bool>();
List<string> currentLayer = new List<string>();
for (int i = 0; i < vDrawing.LayersCount; i++)
{
layerName.Add(vDrawing.GetLayerName(i));
layerVisible.Add(vDrawing.GetLayerVisible(i));
layerColor.Add(vDrawing.GetLayerColor(i));
layerForzen.Add(vDrawing.GetLayerFreeze(i));
}