Message 1 of 12
Export 2d sheets as images with high quality
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
@Anonymous
I’m trying to export Revit sheets to images with high quality. I use a code you have already shared before:
/// <summary>
/// New code as described in Revit API discussion
/// forum thread on how to export an image from a
/// specific view using Revit API C#,
/// http://forums.autodesk.com/t5/revit-api/how-to-export-an-image-from-a-specific-view-using-revit-api-c/m-p/6424418
/// </summary>
static Result ExportToImage3( Document doc )
{
Result r = Result.Failed;
using( Transaction tx = new Transaction( doc ) )
{
tx.Start( "Export Image" );
string desktop_path = Environment.GetFolderPath(
Environment.SpecialFolder.Desktop );
View view = doc.ActiveView;
string filepath = Path.Combine( desktop_path,
view.Name );
ImageExportOptions img = new ImageExportOptions();
img.ZoomType = ZoomFitType.FitToPage;
img.PixelSize = 32;
img.ImageResolution = ImageResolution.DPI_600;
img.FitDirection = FitDirectionType.Horizontal;
img.ExportRange = ExportRange.CurrentView;
img.HLRandWFViewsFileType = ImageFileType.PNG;
img.FilePath = filepath;
img.ShadowViewsFileType = ImageFileType.PNG;
doc.ExportImage( img );
tx.RollBack();
filepath = Path.ChangeExtension(
filepath, "png" );
Process.Start( filepath );
r = Result.Succeeded;
}
return r;
}
I tried to increase the pixel size to its limits (15000) however though when I zoom in the exported image it is not with good quality and some details are not fine.
Some lines are thick and I tried to manage this from object style by setting Cut and Projection size to 1 but though the lines come thick.
Any advice?