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?
Solved! Go to Solution.
Solved by jeremytammik. Go to Solution.
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
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.
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:
Cheers,
Jeremy
Shared for posterity by The Building Coder:
Cheers,
Jeremy