mesh data export to json

mesh data export to json

Anonymous
Not applicable
2,942 Views
4 Replies
Message 1 of 5

mesh data export to json

Anonymous
Not applicable

I try to get the geometry info from ***.rvt, to a json data ,which can I load to draw geometry by three.js.

 

This page: https://thebuildingcoder.typepad.com/blog/2013/07/adn-mesh-data-custom-exporter-to-json.html

 

Him had show me how to do.

 

Of course, the demo is right and work well by some changes from revit 2015or6 to 2019.

 

https://thebuildingcoder.typepad.com/files/curvedwall.rvt

 

this reivt file work well in my computer.

 

But when I do with other revit file, error comes from the 

 

     exporter.Export(view)

 

which the error say: cannot devide by zero

 

PS:The view is not null.

 

Could anyone tell any ideas? 

0 Likes
Accepted solutions (1)
2,943 Views
4 Replies
Replies (4)
Message 2 of 5

jeremytammik
Autodesk
Autodesk

Run the add-in in the debugger and see for yourself which line of code is causing the problem.

 

Then you will probably be able to see how to fix it as well.

 

Cheers,

 

Jeremy

 



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes
Message 3 of 5

Anonymous
Not applicable

It is not a good way to find the error by the debugger.

 

The debugger will just raise a error top of the logic.Which I mean,it would not show the error in CustomExportContext.

of course,may be I do the debugger not the right way.

 

Finally I add the try catch and get the error:

 

the file xxx.rvt you show before is different from the file I actually use. which I mean:

the CustomExportContext just started and go into the elementbegin and then,to the elementend.

the Complete methd will do x/0 ,which show the error top: cannot devide by zero.

 

Now ,may I had solved this error. 

 

Thank you very much,Thanks for your demo about the use of CustomExportContext.

0 Likes
Message 4 of 5

jeremytammik
Autodesk
Autodesk
Accepted solution

Glad to hear you resolved your problem.

 

By the way, rather belatedly, may I point out that others ran into the same problem in the past:

 

https://thebuildingcoder.typepad.com/blog/2016/07/exporting-rvt-bims-to-webgl-and-forge.html#3

 

The exception thrown by the internal custom exporter implementation can simply be caught and ignored:

 

https://github.com/jeremytammik/CustomExporterAdnMeshJson/commit/23a95aad8f4a3cca85a72b32e2b699bde1d...

  

Cheers,

  

Jeremy

  



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 5 of 5

jeremytammik
Autodesk
Autodesk

Shared for posterity by The Building Coder:

 

https://thebuildingcoder.typepad.com/blog/2018/12/dynamo-symbol-vs-type-and-exporter-exception.html#...

 

Cheers,

 

Jeremy

 



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes