I am working through the 4-part Autodesk University course from 2019 on Dynamo for BIM managers. In part 3, one of the ‘Shippable Scripts’ uses rhythm’s node Applications.OpenDocumentFile node. I have Revit 2021 and the latest version of Dynamo and rhythm, and that node has been removed in the latest version. Does anyone have a suggestion for another node to use here (or a workaround)?
Hmm, try this latest update. I was
very very close to removing it permanently, but I changed my mind. (TLDR: The dynamo team needs to change some stuff for those nodes to work reliably.)
and this is how the library should look after:
Thanks for the quick response - it works great now! I wrongly assumed that since I just downloaded Rhythm a few months ago, I had the most recent version - you guys are on it!
any python version to use?
It’s not removed, the code is open source for you to see… I say take a look and try to make it in python.
/// <param name="filePath">The file to obtain document from.</param>
/// <param name="audit">Choose whether or not to audit the file upon opening. (Will run slower with this)</param>
/// <param name="detachFromCentral">Choose whether or not to detach from central upon opening. Only for RVT files. </param>
/// <param name="preserveWorksets">Choose whether or not to preserve worksets upon opening. Only for RVT files. </param>
/// <param name="closeAllWorksets">Choose if you want to close all worksets upon opening. Defaulted to false.</param>
/// <returns name="document">The document object. If the file path is blank this returns the current document.</returns>
/// Application.OpenDocumentFile, rhythm
public static object OpenDocumentFile(string filePath, bool audit = false, bool detachFromCentral = false, bool preserveWorksets = true, bool closeAllWorksets = false)
var uiapp = DocumentManager.Instance.CurrentUIApplication;
var app = uiapp.Application;
//instantiate open options for user to pick to audit or not
OpenOptions openOpts = new OpenOptions
Audit = audit,
DetachFromCentralOption = detachFromCentral == false ? DetachFromCentralOption.DoNotDetach :
preserveWorksets == true ? DetachFromCentralOption.DetachAndPreserveWorksets :