Exports the current view or a selection of views in DWF format.
Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 24.0.0.0 (24.0.0.0)
Syntax
Visual Basic |
---|
Public Function Export ( _
folder As String, _
name As String, _
views As ViewSet, _
options As DWFExportOptions _
) As Boolean |
Parameters
- folder
- Type: System..::..String
Output folder, into which file(s) will be exported. The folder must exist.
- name
- Type: System..::..String
Either the name of a single file or a prefix for a set of files.
If nullNothingnullptra null reference (Nothing in Visual Basic) or empty, automatic naming will be used.
- views
- Type: Autodesk.Revit.DB..::..ViewSet
Selection of views to be exported.
- options
- Type: Autodesk.Revit.DB..::..DWFExportOptions
Various options applicable to the DWF format.
If nullNothingnullptra null reference (Nothing in Visual Basic), all options will be set to their respective default values.
Return Value
Function returns true only if all specified views are exported successfully. Returns False if exporting of any view fails,
even if some views might have been exported successfully.
Remarks
Examples
CopyC#
public bool ExportViewToDWF(Document document, View view, string pathname)
{
DWFExportOptions dwfOptions = new DWFExportOptions();
dwfOptions.CropBoxVisible = true;
dwfOptions.ExportingAreas = true;
dwfOptions.ExportTexture = false;
ViewSet views = new ViewSet();
views.Insert(view);
return (document.Export(Path.GetDirectoryName(pathname),
Path.GetFileNameWithoutExtension(pathname), views, dwfOptions));
}
CopyVB.NET
Public Function ExportViewToDWF(document As Document, view As View, pathname As String) As Boolean
Dim dwfOptions As New DWFExportOptions()
dwfOptions.CropBoxVisible = True
dwfOptions.ExportingAreas = True
dwfOptions.ExportTexture = False
Dim views As New ViewSet()
views.Insert(view)
Return (document.Export(Path.GetDirectoryName(pathname), Path.GetFileNameWithoutExtension(pathname), views, dwfOptions))
End Function
Exceptions
See Also