Revit二次开发将当前项目中某些视图导出成图片
/// <summary>
/// 保存图片
/// </summary>
/// <param name="doc">当前项目</param>
/// <param name="pathimg">图片路径</param>
/// <param name="eids">视图id</param>
private void LoadMain(Document doc, string pathimg, IList<ElementId> eids)
{
ImageExportOptions options1 = new ImageExportOptions();
options1.ZoomType = ZoomFitType.FitToPage;
options1.SetViewsAndSheets(eids);
// VisibleRegionOfCurrentView 根据视图放大缩小生成对应大小的图片
//CurrentView 自动缩放默认取整个完整视图
options1.ExportRange = ExportRange.SetOfViews;
options1.FilePath = pathimg;//导出的路径
options1.FitDirection = FitDirectionType.Vertical;
options1.HLRandWFViewsFileType = ImageFileType.JPEGLossless;//无损画质
options1.ShadowViewsFileType = ImageFileType.JPEGLossless;
//options.Zoom
options1.PixelSize = 2000;
doc.ExportImage(options1);
}