Revit文件导出二维视图(view2D)

博客提及若设置了二维视图的生成设置,需添加setupName进行过滤;若未设置,则直接按第一个设置选项导出,并表示直接给出源代码。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

不废话,直接上源代码。

如果有设置了二维视图的生成设置,请添加setupName进行过滤。如果没有,请直接按第一个设置选项导出。

        private bool ExportDWGF(Document document,View view,string setupName)
        {
            bool exported = false;
            IList<string> setupNames = BaseExportOptions.GetPredefinedSetupNames(document);
            foreach(string name in setupNames)
            {
               // if(name.CompareTo(setupName)==0)
               // {               
                    DWGExportOptions dwgOptions = DWGExportOptions.GetPredefinedOptions(document, name);
                    ICollection<ElementId> views = new List<ElementId>();
                    views.Add(view.Id);
                    exported = document.Export(Path.GetDirectoryName(document.PathName), Path.GetFileNameWithoutExtension(document.PathName),
                        views, dwgOptions);
                    break;
            //    }
            }
            return exported;
        }

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值