一、直接导出图纸方法:
commandData.Application.ActiveUIDocument.Document.ExportImage(new ImageExportOptions()
{FilePath= Environment.GetFolderPath(Environment.SpecialFolder.Desktop)+"\图纸.png", PixelSize = 5000, ShadowViewsFileType = ImageFileType.PNG, HLRandWFViewsFileType = ImageFileType.PNG });
二、调用revit自身的导出图片图纸界面:
using (Transaction trans = new Transaction(commandData.Application.ActiveUIDocument.Document, "导出图纸")) { trans.Start(); RevitCommandId cmdid = RevitCommandId.LookupPostableCommandId(PostableCommand.ExportImagesandAnimationsImage); commandData.Application.PostCommand(cmdid); trans.Commit(); }