Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

mesh data export to json

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
bigpangl
2027 Views, 4 Replies

mesh data export to json

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? 

Tags (1)
4 REPLIES 4
Message 2 of 5
jeremytammik
in reply to: bigpangl

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

Message 3 of 5
bigpangl
in reply to: jeremytammik

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.

Message 4 of 5
jeremytammik
in reply to: bigpangl

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
in reply to: bigpangl

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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Rail Community