完善主體資料,免費(fèi)贈(zèng)送VIP會(huì)員!
* 主體類型
* 企業(yè)名稱
* 信用代碼
* 所在行業(yè)
* 企業(yè)規(guī)模
* 所在職位
* 姓名
* 所在行業(yè)
* 學(xué)歷
* 工作性質(zhì)
請(qǐng)先選擇行業(yè)
您還可以選擇以下福利:
行業(yè)福利,領(lǐng)完即止!

下載app免費(fèi)領(lǐng)取會(huì)員

NULL

ad.jpg

二次開發(fā)教程:Revit開發(fā)ImageView

發(fā)布于:2019-07-24 16:42:15

網(wǎng)友投稿

更多

在Revit里可以創(chuàng)建渲染,其實(shí)這個(gè)視圖里顯示的是光柵圖像里的圖片。


這個(gè)視圖對(duì)應(yīng)的類是ImageView,


如果要?jiǎng)?chuàng)建一個(gè)這樣的視圖,可以用這個(gè)類的Create靜態(tài)方法,


        public static ImageView Create(Document document, string imageFileName);




下面是一個(gè)導(dǎo)出當(dāng)前視圖圖像,并創(chuàng)建一個(gè)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;

本文版權(quán)歸腿腿教學(xué)網(wǎng)及原創(chuàng)作者所有,未經(jīng)授權(quán),謝絕轉(zhuǎn)載。

未標(biāo)題-1.jpg

上一篇:二次開發(fā)教程:Revit開發(fā)IExternalCommandAvailability的使用

下一篇:二次開發(fā)教程:Revit開發(fā)BuildingEnvelopeAnalyzer

60acb4e0ef112.png