Document.Export

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I am trying to export a dwg file. The following code works in Windows 7, but does not work in Windows 8. I can't find any reason why it wouldn't. Can someone tell me what I am doing wrong? Both windows systems are running Revit 2015 with service pack 2.
string exportfolder = "C:\Revit\Exports\";
string filename = "FirstFloor.DWG";
var tmpViews = new List<ElementId>() { _view.Id };
DWGExportOptions _dwgExportOptions = new DWGExportOptions()
{
ExportingAreas = true,
ExportOfSolids = SolidGeometry.Polymesh,
FileVersion = ACADVersion.R2010,
LayerMapping = "AIA",
LineScaling = LineScaling.PaperSpace,
MergedViews = false,
PropOverrides = PropOverrideMode.ByEntity,
SharedCoords = false,
TargetUnit = ExportUnit.Default,
TextTreatment = TextTreatment.Exact
};
_view.Document.Export(exportfolder, filename, tmpViews, _dwgExportOptions); <-----Fails here with "Object reference not set to instance of an object"