Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for
Show only
|
Search instead for
Did you mean:
This page has been translated for your convenience with an automatic translation service. This is not an official translation and may contain errors and inaccurate translations. Autodesk does not warrant, either expressly or implied, the accuracy, reliability or completeness of the information translated by the machine translation service and will not be liable for damages or losses caused by the trust placed in the translation service.Translate
In case I'm doing something wrong coding here is the code snippet that I'm using for the pdf export.
using (Transaction t = new Transaction(doc, "Mario Tools: Export Sheets to PDF"))
{
// start the transaction
t.Start();
// create DWG export options
PDFExportOptions exportOptions = new PDFExportOptions();
//gets size from title block
exportOptions.PaperFormat = ExportPaperFormat.Default;
exportOptions.ColorDepth = ColorDepthType.Color;
exportOptions.Combine = thisForm.checkBoxCombine.Checked;
exportOptions.FileName = fileName; //only works if Combine is True
exportOptions.ExportQuality = PDFExportQualityType.DPI600;
exportOptions.HideCropBoundaries = true;
exportOptions.HideReferencePlane = true;
exportOptions.HideScopeBoxes = true;
exportOptions.HideUnreferencedViewTags = true;
exportOptions.MaskCoincidentLines = true;
//Don't think of this as a "continue" but rather as a silent mode
exportOptions.StopOnError = true;
////Make sure to not use these settings as they don't work if 'Default' size is used above
//exportOptions.PaperPlacement = PaperPlacementType.LowerLeft;
////Make sure to not use these settings as they don't work if 'Default' size is used above
//exportOptions.ZoomType = ZoomType.Zoom;
////Make sure to not use these settings as they don't work if 'Default' size is used above
//exportOptions.ZoomPercentage = 100;
exportOptions.ViewLinksInBlue = false;
//Get all sheets to export
// create a list to hold the sheets
List<ElementId> sheetsToExportIds = (from View eachview in selectedViewSet.Views select eachview.Id).ToList();
// export
try
{
doc.Export(path, sheetsToExportIds, exportOptions);
summary += "- OK: Files exported correctly to <" + path+ ">." + Environment.NewLine;
}
catch (FileAccessException e)
{
summary += "- FAIL: The File already exists/The File is already open/No ovewrite option is available in th API for now." + Environment.NewLine;
summary += "- FAIL: Exception: " + e.Message + Environment.NewLine;
summary += "- FAIL: Exception: " + e.StackTrace + Environment.NewLine;
}
catch (Exception e)
{
summary += "- FAIL: Failed at Export Command" + Environment.NewLine + Environment.NewLine;
summary += "- FAIL: Exception: " + e.Message + Environment.NewLine;
summary += "- FAIL: Exception: " + e.StackTrace + Environment.NewLine;
}
t.Commit();
}
@a.bejenaru , we're going to leave this one as a new feature request, but know that it is being looked at as a possible bug. I will let you know if anything changes!
Yes, it could also be because the files is in use, which I would presume is why the API method does not attempt to overwrite, but provides the exception.