Hi all,
I’m building a batch family editor. I would like to add the functionality that if, for a given family, any editing instructions throw an exception, that family is opened in the Family Editor UI.
The current script throws an exception as I’m using OpenAndActivate. I’m looking for JustOpen, if it’s there. I found OpenDocumentFile, is that it?
The exception tells me that I’m not allowed to switch the active document, which makes sense. There is nothing in the UI preventing me to open another document, it just can’t be the active document if Dynamo is to continue to operate on the active document.
Yes, OpenDocumentFile opens the DB level document in the background. What is the exact exception being thrown? I have used OpenDocumentFile in the past for batch editing of documents within a single directory, but I’m not sure your workflow will work with Dynamo, which only points at a single UIDocument at a given time.
From what I have been able to find, I don’t think it’s possible to do exactly what you want (switch to the Family Editor). In order for the family editor to be open, the document is inherently the active document. Given that you cannot switch active documents (as evidenced by the exception), I think your only option is to modify the documents in the background. You can work in some try-except statements to output the name of the specific family (and possibly its category) so the user knows which family to open manually, but I don’t think this can be done automatically.
Alright, makes sense. Thanks for looking in to it! I already made a report output which included a saved path, so that’s as far as it goes, I guess. Good enough.