Cannot finish opening BIM 360 model using: OpenAndActivateDocument() in an Idling event
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
If I use this code in an Idling event the model opens (I think) but Revit stops processing and keeps the 'Open Model' dialog on the screen (Revit isn't frozen, the 'Open Model' dialog can be moved around but does not close). If I use OpenAndActivateDocument() in the same Idling event to open a conventional RVT it works correctly. The test project is in the US, I deleted the BIM 360 cache, computer temp files and preference files. The same model opens very quickly if I do so manually in Revit 2022. Any ideas? I guess either an issue with my code, OpenAndActivateDocument() should not be used in an Idling event or it's an API issue.
P.S. I use OpenDocumentFile() in the same manner to automate printing and it works fine with BIM 360 models.
Guid oProjectGuid = new Guid("36d1c256-321c-4b5a-8672-b15848836dae");
Guid oModelGuid = new Guid("82e392bf-46a6-4638-acbb-c04425a071e0");
ModelPath oModelPath = ModelPathUtils.ConvertCloudGUIDsToCloudPath(ModelPathUtils.CloudRegionUS, oProjectGuid, oModelGuid);
OpenOptions oOpenOpts = new OpenOptions();
UIDocument oUIDocument = oUIApplication.OpenAndActivateDocument(oModelPath, oOpenOpts, false);
Thanks for any assistance,
Dan