Revit 调用自己的窗体,以及导出图纸图片

一、直接导出图纸方法:

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();
                }

posted on 2021-02-25 16:26  梦琪小生  阅读(319)  评论(1编辑  收藏  举报

导航