GeometryGym / GeometryGymIFC

C# classes to generate and parse OpenBIM IFC files
Other
269 stars 97 forks source link

No Progression estimate/feedback when creating a IFCDatabase from file. #53

Open jonastikab opened 2 years ago

jonastikab commented 2 years ago

I am trying to provide some feedback/estimate to a user. But I find no way to load my ifc file except trough the constructor, that I have to call in a separate thread, it prevents the application from freezing when loading large files, but at the same time I really have nothing to provide any kind of feedback to the user.

Would there be possible to create a IFCDatabase object, and either provide it line by line from a file, and atleast let me provide feedback of lines of total thats been processed, or that the IFCDatabase have a LoadFromFile function or somesuch that provides a progression callback.

I am working with quite large IFC files, and guessing the load time from nothing gives inaccurate results and feedback and the assumption from users that the application have frozen/failed.

jmirtsch commented 2 years ago

Yes, this is a great request. I would like this as a feature in my own developments.

If you (or anyone else) has strategies (or even a pull request) on to achieve this, it would be appreciated. I will do my best to consider this ASAP but I can't promise a timeline.

simonedd commented 2 years ago

Hi,

I think the slowest part is the Parallel.Foreach in the importLines() method. Maybe you can add a progress report in the loop, something like this: https://stackoverflow.com/questions/61608441/updating-progressbar-in-parallel-loop