Progress bar for CustomExporter

ebarMLN7G
Enthusiast

Progress bar for CustomExporter

ebarMLN7G
Enthusiast
Enthusiast

I am working on adding a progress bar to my implementation of custom exporter. The idea is to progress the bar after processing every element. To make that work properly, I need to know how many elements I should expect. 

 

I know there are several ways to get the elements that represent 3D geometry in a document, but none of them appear to give me the correct number. 

 

Is there a way to know how many elements I should expect when I export a model with custom exporter? If not, what's the best approximation ?

0 Likes
Reply
407 Views
1 Reply
Reply (1)

jeremytammik
Autodesk
Autodesk

The custom exporter works with a specific 3D view. Actually, nowadays, it can even be a 2D view.

 

You could simply run a filtered element collector with that view element id argument to retrieve the total number of elements visible in that view. Maybe you can specify additional filter criteria to limit the number to the truly visible elements with geometry that does indeed get routed to the custom exporter.

 

After running the custom exporter, you can always compare the predicted number and the true count of processed elements to see how far off the estimate was.

 

Please let us know what you find out.

 

Thank you!

 

Best regards,

 

Jeremy

 



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

0 Likes