How to view DWF file layers
Design Web Format File (.dwf) consists of various user layers. Layers represent various parts of the entire drawing, for example, this drawing describes a plan of a building and it’s parts like stairs, walls, doors located in different layers.
Background
Let’s take a sample DWF described above and then we’ll process with GroupDocs.Viewer and compare results.
By default GroupDocs.Viewer renders all layers:
How to view only specific layers
If you want to view only specific layers you can set CadOptions.Layers property of HtmlViewOptions (or PngViewOptions, or JpgViewOptions, orPdfViewOptions) class.
Let’s view only “Doors”, “Stairs”, “Walls” layers, to do that use following code,
using (Viewer viewer = new Viewer("sample.dwf"))
{
PngViewOptions viewOptions = new PngViewOptions();
options.CadOptions.Layers.Add(new Results.Layer("Stairs"));
options.CadOptions.Layers.Add(new Results.Layer("Walls"));
options.CadOptions.Layers.Add(new Results.Layer("Doors"));
viewer.View(viewOptions);
}
Now GroupDocs.Viewer will render only these layers:
More resources
View CAD Drawings Online
Along with full-featured .NET library we provide simple but powerful free online Apps. View DXF, DWG, and DWF files online with GroupDocs Viewer App.
GitHub Examples
You may easily run the code above and see the feature in action in our GitHub examples:
- GroupDocs.Viewer for .NET examples, plugins, and showcase
- GroupDocs.Viewer for Java examples, plugins, and showcase
- Document Viewer for .NET MVC UI Example
- Document Viewer for .NET App WebForms UI Modern Example
- Document Viewer for Java App Dropwizard UI Modern Example
- Document Viewer for Java Spring UI Example