下載app免費領取會員
在Revit里可以創建渲染,其實這個視圖里顯示的是光柵圖像里的圖片。
這個視圖對應的類是ImageView,
如果要創建一個這樣的視圖,可以用這個類的Create靜態方法,
public static ImageView Create(Document document, string imageFileName);
下面是一個導出當前視圖圖像,并創建一個ImageView的例子
Document doc = commandData.Application.ActiveUIDocument.Document;
Transaction trans = new Transaction(doc, "ex");
trans.Start();
ImageExportOptions options = new ImageExportOptions();
options.ExportRange = ExportRange.CurrentView;
options.FitDirection = FitDirectionType.Horizontal;
options.ImageResolution = ImageResolution.DPI_600;
options.HLRandWFViewsFileType = ImageFileType.PNG;
options.ViewName = "testView";
options.ZoomType = ZoomFitType.FitToPage;
options.FilePath = @"D:\tessst.png";
doc.ExportImage(options);
ImageView v = ImageView.Create(doc, @"D:\tessst.png");
v.ViewName = "TestV";
trans.Commit();
return Result.Succeeded;
本文版權歸腿腿教學網及原創作者所有,未經授權,謝絕轉載。
上一篇:二次開發教程:Revit開發IExternalCommandAvailability的使用
下一篇:二次開發教程:Revit開發BuildingEnvelopeAnalyzer
推薦專題