Retrieve geometry too slow.

Retrieve geometry too slow.

bezzubikov
Explorer Explorer
348 Views
1 Reply
Message 1 of 2

Retrieve geometry too slow.

bezzubikov
Explorer
Explorer

Hi.

I'm doing an add-in to extract 3d geometry (let's call it GetGeo) of elements and came across behavior that I can't understand. Now I have two options for wrapping the main logic of getting 3d, and in all cases the behavior is different, but there seems to be a pattern.

 

1. Library with an entry point via IExternalCommand, activated via Add-In Manager.
In this case, if I open revit and call GetGeo to export one document, and then close revit, everything happens quickly, but if I continue to process other documents with GetGeo, then the 2nd and all the following will be processed about 7 times slower (a document of about 70k elements and a size of 280MB is processed for the first time 50 seconds, and the next 300-400 seconds)

 

2. A library with an entry point through IExternalDBApplication, activated when Revit is launched and using System.IO.FileSystemWatcher and IExternalEventHandler monitors the folder, when a new rvt file appears, it opens it in turn through Application.OpenDocumentFile and the document is processed in getgeo. In this case, the situation is absolutely the opposite, the first document, regardless of size, is processed for a long time (the same example for 280MB is also 300-400 seconds), and all the following are fast. Even if I delete and insert this 280MB rvt file, the first time it will be processed for 300-400 seconds, the remaining times are 50 seconds.

0 Likes
349 Views
1 Reply
Reply (1)
Message 2 of 2

jeremy_tammik
Alumni
Alumni

Sounds to me as if the second option is the better one. I cannot explain the behaviour, though. If you would like to share a minimal reproducible case here for people to take a look at, maybe somebody can say something more:

  

http://jeremytammik.github.io/tbc/a/#1b

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes