70001343 Export specific layout or layouts in DWF format

Article 70001343
Type Wish
Product Converter
Version 7014
Date Added 6/6/2018 12:00:00 AM
Fixed 7.7015.0.6 (6/7/2018 12:00:00 AM)
Submitted by Paul Woodcock

Summary

Is it possible to export specific layout or layouts into .DWF format?

Solution

In version 7.7015.1.0 and up, the export of 2D .DWF files has changed. The VisibleOnForms property of vdLayouts (including model) controls the layouts that are going to be exported in 2D .DWF.

So, in order to export a specific layout or specific layouts into a single 2D .DWF file you need to set the model/layouts that you don't need to have VisibleOnForms = False.
See the code below:

            vdDocument doc = vdFramedControl1.BaseControl.ActiveDocument;
            doc.Open(@"C:\test\vectordraw.vdml"); // a drawing that contains some layouts
                // including a layout named "MyLayout2".

            //set all layouts except layout named "MyLayout2" to be not visible on forms
            doc.Model.VisibleOnForms = false;
            foreach (vdLayout item in doc.LayOuts)
            {
                if (item.Name != "MyLayout2") item.VisibleOnForms = false;
            }

            //export the layout "MyLayout2" to 2D DWF
            doc.SaveAs(@"C:\test\only_layout.dwf");

            //set back all layouts and model as visible on forms
            doc.Model.VisibleOnForms = true;
            foreach (vdLayout item in doc.LayOuts)
            {
                item.VisibleOnForms = true;
            }

Note that only the layouts that have VisibleOnFOrms=True will be exported to the 2D .DWF file. This change doesn't affect the 3D .DWF export that works as in previous versions.

Send comments on this topic.