EaBIM一直以来积极响应国家“十二五”推进建筑业信息化的号召,对建筑领域的信息技术开展深入技术交流和探讨!致力于打造“BIM-建筑师-生态技术”三位一体综合资源交流共享平台,希望为BIM与可持续设计理念及技术的普及做出微小的贡献!!!

EaBIM

 找回密码
 注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

搜索
查看: 526|回复: 1
打印 上一主题 下一主题

Revit API导出GBXML

[复制链接]

1514

主题

7465

帖子

1万

积分

admin

Rank: 10Rank: 10Rank: 10Rank: 10Rank: 10Rank: 10Rank: 10Rank: 10Rank: 10Rank: 10

积分
12396

社区QQ达人

跳转到指定楼层
楼主
发表于 2014-1-9 13:07:53 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
GBXML是一种中间数据。

  1. <div align="left" style="color: rgb(105, 105, 105); font-family: 'Microsoft Yahei', Simsun; ">[Transaction(TransactionMode.Manual)]
  2. [Regeneration(RegenerationOption.Manual)]
  3. <font style="color: rgb(0, 0, 255); ">public</font> <font style="color: rgb(0, 0, 255); ">class</font> cmdExportGBXML : IExternalCommand
  4. {
  5.     <font style="color: rgb(0, 0, 255); ">public</font> Result Execute(ExternalCommandData cmdData, <font style="color: rgb(0, 0, 255); ">ref</font> <font style="color: rgb(0, 0, 255); ">string</font> msg, ElementSet elements)
  6.     {
  7.         UIDocument uiDoc = cmdData.Application.ActiveUIDocument;
  8.         Document doc = uiDoc.Document;

  9.         Transaction ts = <font style="color: rgb(0, 0, 255); ">new</font> Transaction(uiDoc.Document, <font style="color: rgb(128, 0, 0); ">"</font><font style="color: rgb(128, 0, 0); ">导出GBXML</font><font style="color: rgb(128, 0, 0); ">"</font>);
  10.         ts.Start();

  11.         GBXMLExportOptions exportOption = <font style="color: rgb(0, 0, 255); ">new</font> GBXMLExportOptions();
  12.         doc.Export(<font style="color: rgb(128, 0, 0); ">@"</font><font style="color: rgb(128, 0, 0); ">D:\</font><font style="color: rgb(128, 0, 0); ">"</font>, <font style="color: rgb(128, 0, 0); ">"</font><font style="color: rgb(128, 0, 0); ">hi123.xml</font><font style="color: rgb(128, 0, 0); ">"</font>, exportOption);

  13.         ts.Commit();

  14.         <font style="color: rgb(0, 0, 255); ">return</font> Result.Succeeded;
  15.     }
  16. }</div>
复制代码
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友 微信微信
收藏收藏 转播转播 分享分享 分享淘帖 支持支持 反对反对
工作时间:工作日的9:00-12:00/13:30-18:00,节假日不在线,请勿留言
*滑块验证:
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|EaBIM网 ( 苏ICP备2020058923号-1  苏公网安备32011502011255号

GMT+8, 2024-9-29 14:23

Powered by Discuz! X3.2 Licensed

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表