All Projects → weiyu666 → RevitExportObjAndGltf

weiyu666 / RevitExportObjAndGltf

Licence: GPL-2.0 license
The Revit-based plug-in realizes the export of 3D files in obj or gltf format, which may have small material problems, which can be improved in the later stage; because the project needs to engage in the secondary development of Revit in the near future, similar plug-ins are rarely found on the Internet Related information will be recommended to…

Programming Languages

C#
18002 projects

Projects that are alternatives of or similar to RevitExportObjAndGltf

FreeMVD WorkFlow
This project has been moved/forked to https://gitlab.com/osarch/FreeMVD_WorkFlow
Stars: ✭ 21 (-50%)
Mutual labels:  revit
RevitTemplates
Templates for creating plugins for Revit
Stars: ✭ 64 (+52.38%)
Mutual labels:  revit
SpeckleRevitReboot
Check a brand new Speckle at: https://github.com/specklesystems
Stars: ✭ 25 (-40.48%)
Mutual labels:  revit
Nina
A collection of Shorcuts to work faster in Revit.
Stars: ✭ 17 (-59.52%)
Mutual labels:  revit
thesaurus
TT Hackathon 2018 - Autocomplete for Visual Programming Nodes
Stars: ✭ 23 (-45.24%)
Mutual labels:  revit
DynAI
Practical applications of AI / Machine Learning in BIM, implemented as a Dynamo Package
Stars: ✭ 24 (-42.86%)
Mutual labels:  revit
revit-family-web-viewer
Revit Web Viewer is a Three.js-based project viewer. Revit projects / families must be exported using RvtVa3cExporter (https://github.com/va3c/RvtVa3c)
Stars: ✭ 48 (+14.29%)
Mutual labels:  revit
GeniusLociForDynamo
Genius Loci is a package of 300+ custom nodes for Dynamo in Revit.
Stars: ✭ 17 (-59.52%)
Mutual labels:  revit
mapboxRevit
View Revit models inside Mapbox
Stars: ✭ 23 (-45.24%)
Mutual labels:  revit
SpeckleRevit
Archived, dev moved to https://github.com/speckleworks/SpeckleRevitReboot
Stars: ✭ 17 (-59.52%)
Mutual labels:  revit
RevitFamilyBrowser
Browser for .rfa Revit family files
Stars: ✭ 82 (+95.24%)
Mutual labels:  revit
Onboxframework
A framework for building Cross-Platform Revit Apps
Stars: ✭ 41 (-2.38%)
Mutual labels:  revit
speckle-sharp
.NET SDK, Schema and Connectors: Revit, Rhino, Grasshopper, Dynamo, ETABS, AutoCAD, Civil3D & more.
Stars: ✭ 214 (+409.52%)
Mutual labels:  revit
Revit2glTF
An open source glTF format exporter for Autodesk Revit.
Stars: ✭ 143 (+240.48%)
Mutual labels:  revit
OrchidForDynamo
This repository contains the content of the Orchid package for Dynamo
Stars: ✭ 81 (+92.86%)
Mutual labels:  revit
RevitExtensions
Extensions for Revit plugin development
Stars: ✭ 37 (-11.9%)
Mutual labels:  revit
FlexLM-License-Usage-Logger
python utility script to parse and log the lmutil lmstat results on a FlexLM server
Stars: ✭ 20 (-52.38%)
Mutual labels:  revit

Plug-in export obj and gltf format based on Revit:

主要使用了RevitAPI.dll 与RevitAPIUI.dll 来Revit的二次开发,其中 : //add-in manger 只读模式 [Transaction(TransactionMode.ReadOnly)] 调试的方式“附加到进程” -> revit 推荐使用vs2019,本人使用vs2017有时候进不到断点中去,这个是编译器出Bug了!

使用了SharpGLTF库,SharpGLTF是一个100%.NET标准库,旨在支持Khronos Group glTF 2.0文件格式。 所以使用SharpGLTF生成gltf、glb数据; 该库分为两个主要软件包: SharpGLTF.Core提供读/写文件支持,以及对glTF模型的低级别访问。 SharpGLTF.Toolkit提供了方便的实用程序来帮助创建,操纵和评估glTF模型。

simple example gltf保存为glb格式: var model = SharpGLTF.Schema2.ModelRoot.Load("model.gltf"); model.SaveGLB("model.glb");

思想: 五行代码搞定导出自定义格式,其中最关键的是IExportContext,需要继承并且实现该接口(主要工作都在这里) IExportContext pExport = new CMyExporter(); CustomExporter exporter = new CustomExporter(doc, pExport); exporter.IncludeGeometricObjects = false; exporter.ShouldStopOnError = true; exporter.Export(view3D);

执行exporter.Export(view3D);后才进行执行IExportContext的Start;

IExportContext接口在数据导出中,执行如下的顺序: 将revit的数据解析为我们自己的数据需要继承重写IExportContext就能revit文件进行数据导出和数据转换; * 接口在数据导出中,无链接模型执行如下的顺序: * Start -> OnViewBegin -> onElementBegin -> OnInstanceBegin ->OnMaterial ->OnLight * ->OnFaceBegin OnPolymesh -> OnFaceEnd -> OnInstanceEnd-> OnElementEnd
* ->OnViewEnd ->IsCanceled ->Finish、 * 假如有链接模型在执行完非链接的OnElementBegin以后,执行OnLinkBegin,然后执行链接模型里的OnElementBegin……依次类推

依赖环境:Autodesk.RevitAPi Autodesk.Revit.UI 安装nodejs 使用工具:使用npm 安装gltf-pipeline配置系统环境

参考资料: gltf格式 https://zhuanlan.zhihu.com/p/65265611 解决材质的问题 https://zhuanlan.zhihu.com/p/80465384
revit 二开环境配置 https://static.app.yinxiang.com/embedded-web/profile/#/join?guid=1e6bb87f-5eb1-4654-aeb5-22c3cb67431c&channel=copylink&shardId=s61&ownerId=22360100

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].