Dear Artur,
Thank you for your update and renewed prompting.
Yes, I have reproduced the issue.
To do so, I migrated the sample you pointed out to Revit 2017 and posted it on GitHub:
https://github.com/jeremytammik/CustomExporterCollada
When I run the command and activate the mouse scroll wheel, an exception of type ExternalApplicationException is thrown from within the call to `exporter.Export(view3D)`, saying
Object reference not set to an instance of an object.
I remember seeing the same exception being thrown once before.
It was reported in several comments by Helen Huang on
http://thebuildingcoder.typepad.com/blog/2013/07/adn-mesh-data-custom-exporter-to-json.html
I reported it to the development team in the database issue REVIT-94525 [API CustomExporter throws ExternalApplicationException after call to Finish].
This issue has been verified by the development team and classified as Code Fix Needed, submitting a new issue REVIT-100187 [API CustomExporter throws ExternalApplicationException after call to Finish].
That issue is still open.
I added a note of your report to it.
The case faced by Helen was easy to work around: simply add an exception handler around the call to `Finish`:
try
{
exporter.Export( view );
}
catch( Autodesk.Revit.Exceptions.ExternalApplicationException ex )
{
Debug.Print( "ExternalApplicationException " + ex.Message );
}
Here is the code for that case on GitHub:
https://github.com/jeremytammik/CustomExporterAdnMeshJson
Here is the fix I applied:
https://github.com/jeremytammik/CustomExporterAdnMeshJson/blob/master/CustomExporterAdnMeshJson/Comm...
I created a new GitHub repository for the sample you pointed to:
https://github.com/jeremytammik/CustomExporterCollada
It contains the code you point to in a solution for Revit 2017.
I added the same workaround to your code as well:
https://github.com/jeremytammik/CustomExporterCollada/commit/f734407aca033c42295e8748544d630ee51075c...
That seems to resolve the problem.
The fixed version is marked as release 2017.0.0.1:
https://github.com/jeremytammik/CustomExporterCollada/releases/tag/2017.0.0.1
I hope this helps.
Best regards,
Jeremy