Bulk change cloud models using Revit Batch Processor

Bulk change cloud models using Revit Batch Processor

floretti
Advocate Advocate
145 Views
1 Reply
Message 1 of 2

Bulk change cloud models using Revit Batch Processor

floretti
Advocate
Advocate

Hi all,

 

Has anybody managed to successfully save changes to several non-workshared cloud models using the Revit Batch Processor?

 

I need to make a small change to about 1000x models stored in ACC and not workshared. I can make the changes without issues but the saving process takes about a minute per model and the Revit Batch Processor seems to move on to the next model without letting the save process complete.

 

I've already tried multiple options (shown below) without success.

// Sleep Option
doc.Save();
System.Threading.Thread.Sleep(30000);

// Await Option
doc.Save();
await Task.Delay(30000);

// Postable Command Option
RevitCommandId saveCommandId = RevitCommandId.LookupPostableCommandId(PostableCommand.Save);

if (uiapp.CanPostCommand(saveCommandId))
{
	uiapp.PostCommand(saveCommandId);
}

// DoEvents Option
doc.Save();
for (int i = 0; i < 10; i++)
{
	// Processes all Windows messages currently in the message queue
	System.Windows.Forms.Application.DoEvents();

	// Brief pause to allow background threads to progress
	System.Threading.Thread.Sleep(1000);
}

 

I'm using project and model GUIDs to open each model and a combination of a C# dll with a python script to run the C# method.

 

When I try to open one of the models a couple of minutes later I get the message below showing that I have a cached version of the model that includes changes that were never sync'd to the cloud model.

floretti_0-1776207029996.png

 

Thanks for reading.

0 Likes
Accepted solutions (1)
146 Views
1 Reply
Reply (1)
Message 2 of 2

floretti
Advocate
Advocate
Accepted solution

Never mind. I found a different method for saving cloud models is available.

 

Instead of using doc.Save() I need to use doc. SaveCloudModel().

0 Likes