Best method to turn on/off DXF files as layers?
Moderators: SDS, support, admin
Best method to turn on/off DXF files as layers?
I'm a beginner on CADImport fields. So I need a little help.
I have to load multiple DXF files and show them in a common picture.
These separated files are contains different layers from our map. (Example: roads, traffic signals, plants etc.)
I'd like to turn on/off these layers afther they are loaded.
I have found an example (see below) which is always drawing all the loaded DXF files from the first until the last. It means the zoom level and rotation on the common picture is always resetting afther redrawing (loading new file).
Which is the best method, to create turn on/off functionality to different DXF files?
CADImage img1;
if(filesToMerge.Count > 0)
{
for(int i = 0; i < filesToMerge.Count; i++)
{
FileRecord f1 = (FileRecord)filesToMerge;
img1 = CreateCADImage(f1);
image.AddScaledDXF(img1, f1.FileName, f1.Position, f1.Scale, (float)f1.Rotation);
image.UseDoubleBuffering = false;
this.OnResize();
}
Image.GetExtents();
}
I have to load multiple DXF files and show them in a common picture.
These separated files are contains different layers from our map. (Example: roads, traffic signals, plants etc.)
I'd like to turn on/off these layers afther they are loaded.
I have found an example (see below) which is always drawing all the loaded DXF files from the first until the last. It means the zoom level and rotation on the common picture is always resetting afther redrawing (loading new file).
Which is the best method, to create turn on/off functionality to different DXF files?
CADImage img1;
if(filesToMerge.Count > 0)
{
for(int i = 0; i < filesToMerge.Count; i++)
{
FileRecord f1 = (FileRecord)filesToMerge;
img1 = CreateCADImage(f1);
image.AddScaledDXF(img1, f1.FileName, f1.Position, f1.Scale, (float)f1.Rotation);
image.UseDoubleBuffering = false;
this.OnResize();
}
Image.GetExtents();
}
Re: Best method to turn on/off DXF files as layers?
Hello.
The AddScaledDXF method adds drawings as external references. Each added drawing placed to model's entities collection as insert. Just set visibility of such insert to false:
Alexander.
The AddScaledDXF method adds drawings as external references. Each added drawing placed to model's entities collection as insert. Just set visibility of such insert to false:
Code: Select all
cadImage.CurrentLayout.Entities[i].Visibility = false;
cadPictBox.Invalidate();
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support
Re: Best method to turn on/off DXF files as layers?
Thank you! This is what I was looking for.