copy layer from DXF to DXF
Moderators: SDS, support, admin
Re: copy layer from DXF to DXF
Hello Sergey.
I have tested your code, it works perfectly,but when i remove entities and layers and i save to DXF file. ( i have 4 layers)
If i open the file was been created , layers are come back. ( i have 6 layers)
to save i use the fallowing code:
how can i do??
I have tested your code, it works perfectly,but when i remove entities and layers and i save to DXF file. ( i have 4 layers)
If i open the file was been created , layers are come back. ( i have 6 layers)
to save i use the fallowing code:
Code: Select all
this->CADviewer->SaveAsDXF();
Re: copy layer from DXF to DXF
Hello Corentin,
The following code is based on Viewer demo:
If it does not work with your files, please send us some of them for testing to support@cadsofttools.com.
Sergey.
The following code is based on Viewer demo:
Code: Select all
private void mmiDeleteLayer_Click(object sender, EventArgs e)
{
if (this.cadImage == null)
return;
this.cadImage.UseDoubleBuffering = false;
for (int i = this.cadImage.Converter.GetCounts(ConvSection.Entities)-1; i>=0; i--)
{
CADEntity ent = (CADEntity)this.cadImage.Converter.GetSection(ConvSection.Entities).Entities[i];
if (ent.Layer.Name == "1")
this.cadImage.Converter.Entities.Remove(i);
}
CADGroup layersSection = this.cadImage.Converter.GetSection(ConvSection.Layers);
for (int i = layersSection.Entities.Count - 1; i >=0 ; i--)
{
CADLayer entLayer = (CADLayer)layersSection.Entities[i];
if (entLayer.Name == "1")
layersSection.Entities.Remove(i);
}
this.DoResize();
SaveAsDXF(@"c:\DeleteLayer.dxf");
}
Sergey.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support