Revit怎么导出其他文件格式
发表于:2025-12-02 作者:千家信息网编辑
千家信息网最后更新 2025年12月02日,这篇文章主要介绍"Revit怎么导出其他文件格式",在日常操作中,相信很多人在Revit怎么导出其他文件格式问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答"Revit怎么
千家信息网最后更新 2025年12月02日Revit怎么导出其他文件格式
这篇文章主要介绍"Revit怎么导出其他文件格式",在日常操作中,相信很多人在Revit怎么导出其他文件格式问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答"Revit怎么导出其他文件格式"的疑惑有所帮助!接下来,请跟着小编一起来学习吧!
Revit 可以导出多种其他文件格式,比如:DWG,DWF,IFC,NWC等等,主要通过API:doc.Export()方法.
实例代码:
public class ExportToOtherCommand : IExternalCommand { public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements) { UIApplication uiapp = commandData.Application; UIDocument uidoc = uiapp.ActiveUIDocument; Document doc = uidoc.Document; string projectName = Path.GetFileNameWithoutExtension(doc.PathName); string viewName = doc.ActiveView.Name; ////导出Dwf //using (Transaction trans = new Transaction(doc, "Export to Dwf file")) //{ // trans.Start(); // ExportToDWF(doc, $"D:\\Shared\\{projectName}_{viewName}.dwf"); // trans.Commit(); //} ////导出Nwc //ExportToNwc(doc, $"D:\\Shared\\{projectName}_{viewName}.nwc"); ExportToDwg(doc, $"D:\\Shared\\{projectName}_{viewName}.dwg",false); return Result.Succeeded; } /// /// 导出Nwc文件,不需要开启事务 /// /// /// public void ExportToNwc(Document document, string pathFullName) { NavisworksExportOptions nweOptions = new NavisworksExportOptions(); nweOptions.ExportScope = NavisworksExportScope.Model; nweOptions.ViewId = document.ActiveView.Id; //导出是否包括链接模型 nweOptions.ExportLinks = true; //判断是否安装了Navisworks bool isExporterAvailable = OptionalFunctionalityUtils.IsNavisworksExporterAvailable(); if (isExporterAvailable) { string folder = Path.GetDirectoryName(pathFullName); string name = Path.GetFileNameWithoutExtension(pathFullName); document.Export(folder, name, nweOptions); } else { TaskDialog.Show("tip", "导出失败!没有安装Navisworks"); } } /// /// 导出dwf , 导出需要开启事务 /// /// /// /// public void ExportToDWF(Document document, string pathFullName, bool isActiveView = true) { FilteredElementCollector collector = new FilteredElementCollector(document); collector.OfClass(typeof(View)).OfCategory(BuiltInCategory.OST_Views); DWFExportOptions dwfOptions = new DWFExportOptions { CropBoxVisible = true, ExportingAreas = true, ExportTexture = false }; ViewSet views = new ViewSet(); if (isActiveView) { views.Insert(document.ActiveView); } else { //多个视图 foreach (View view in collector.ToElements()) { if (view.CanBePrinted) { views.Insert(view); } } } string folder = Path.GetDirectoryName(pathFullName); string name = Path.GetFileNameWithoutExtension(pathFullName); document.Export(folder,name, views, dwfOptions); } public void ExportToDwg(Document document, string pathFullName, bool isActiveView = true) { FilteredElementCollector collector = new FilteredElementCollector(document); collector.OfClass(typeof(View)).OfCategory(BuiltInCategory.OST_Views); DWGExportOptions dwgOptions = new DWGExportOptions { FileVersion = ACADVersion.R2010, }; string folder = Path.GetDirectoryName(pathFullName); string name = Path.GetFileNameWithoutExtension(pathFullName); List viewIds = new List(); if (isActiveView) { viewIds.Add(document.ActiveView.Id); } else { //多个视图 foreach (View view in collector.ToElements()) { if (view.CanBePrinted) { viewIds.Add(view.Id); } } } document.Export(folder, name, viewIds, dwgOptions); } } 到此,关于"Revit怎么导出其他文件格式"的学习就结束了,希望能够解决大家的疑惑。理论与实践的搭配能更好的帮助大家学习,快去试试吧!若想继续学习更多相关知识,请继续关注网站,小编会继续努力为大家带来更多实用的文章!
文件
格式
学习
事务
多个
方法
更多
视图
帮助
实用
接下来
代码
多种
实例
文章
模型
理论
知识
篇文章
网站
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
我的世界租借服务器管理员权限
idea数据库建表没有数据
数据库复杂表如何创建
网络安全风控体系
六盘水定制软件开发
入侵检测网络安全
手机软件开发编程语言
江苏省教育网络安全与信息化
网络技术转移市价
oracle数据库免费
浪潮服务器怎么查看磁盘阵列
加入网络安全队伍有什么用
任意游官网服务器密码
分类(数据库术语)
杭州欧奇网络技术
互联网科技产品营销案例
方舟生存进化服务器作弊管理
四川程序软件开发费用是多少
三分技术七分管理网络安全
开票管理器应用服务器
网络安全王永健
方舟大型服务器一个月能挣多少钱
Ibm服务器代码01
四川信息化少儿编程软件开发
软件开发行业注册资本
原神下错服务器怎么解决
数据库2错误的是
深圳正规网络技术质量保障
网络安全监测装置针对服务器
网络安全主题班级