Batch .rvt update

@Mostafa_El_Ayoubi, stop making the rest of us look bad!!! :wink:

4 Likes

ahah my bad i should have thanked both of you @john_pierson :grinning:

2 Likes

7 Likes

I am New to Dynamo I canā€™t find the ā€œDocument.BackgroundOpenā€

From package Rhythm.

Also @Mostafa_El_Ayoubiā€™s workflow is more complete an works with Dynamo player. Package data-shapes

1 Like

Thatā€™s actually more credit than I deserve ! :slight_smile: @Mauro used Rhythm and Data-Shapes to create his workflow to batch upgrade files with a nice User Interface

2 Likes

Hey, John. Was just curious if you ever got a chance to investigate on errors with upgraded files and upgrading families. Thanks!

I have not unfortunately. :disappointed:

Do you think this could be adapted to reload a titleblock on multiple files?

Possibly, mind start a new topic and outlining your ideas?

I am on it!

1 Like

@john_pierson Any way to modify this so that it saves the file as a central model? We are moving file servers and we have a bunch of Workshared models that will need to be resaved to the new location as central models.

I donā€™t see why not. It will just take some time, which I am a bit short on at the moment. :slight_smile:

Can you point me in the right direction? I can get a python script that does a doc.SaveAs(path), but I donā€™t know the right syntax to add the SaveAsCentral option.

Thanks

Here is what I have so far I have been trying to just save the current document as central.

#import libraries and reference the RevitAPI and RevitAPIUI
import clr
import math
clr.AddReference(ā€˜RevitAPIā€™)
clr.AddReference(ā€˜RevitAPIUIā€™)
from Autodesk.Revit.DB import *

clr.AddReference(ā€œRevitServicesā€)
import RevitServices
from RevitServices.Persistence import DocumentManager

#set the active Revit application and document
doc = DocumentManager.Instance.CurrentDBDocument
path = doc.PathName
path1 = path.Replace(".rvt","_U.rvt")

doc.SaveAs(path1,WorksharingSaveAsOptions.SaveAsCentral)

But I get this error back when I run it

Warning: IronPythonEvaluator.EvaluateIronPythonScript operation failed.
Traceback (most recent call last):
File ā€œā€, line 17, in
TypeError: expected SaveAsOptions, got getset_descriptor

After banging my head against it for a while, I came up with a graph that works. It also filters out backups and files placed in a folder called ā€œHistoryā€

SaveAsCentralFilter.dyn (11.4 KB)
Save.ToCentral.dyf (6.6 KB)

4 Likes

Dude. Nice job @upwallJosh! :ok_hand:


Hi John,
Here is the screenshot of the actual warning before your node.

Can you share the Excel file as well so we can see whatā€™s going on with the code?

We will also be updating soon and i want to try this one.

Thank you for this code! I see in the ā€œapplications.opendocumentsfileā€ node that it gives you the option to preserve worksets. How do I change this to discard worksets?