After one of the last updates, i’ve noticed that it became completely impossible to create a new instance of ViewSheet class in Revit using API from GHpython’s shell.
t = Transaction(doc, "creaete_new_sheet")
t.Start()
new_sheet = ViewSheet.Create(doc,title_block)
t.Commit()
the code throws the following exception: Runtime error (InternalException): A managed exception was thrown by Revit or by one of its external applications.
Simultaneously everything works perfect in a local (non-workshared) model. The same issue occurs both in Revit 2020.2 and Revit 2021.1, using Rhinoceros’ direct Python shell also doesn’t fix the situiation. In the same time the code works as usually in Dynamo’s Python prompt.
This error didn’t occur a week ago; Also it became impossible to duplicate FloorPlanView, but Creating a new instance has proceeded successfully; I have also been trying to open and set the worksets to Editable state (this had helped me to solve some similar problems in the past), but it didn’t help in my case.It is also possible to create/duplicate views manually from UI.
The problem is that i can’t even understand what type of exception i am facing.
Hmm. The only thing that I can think of is that there might be something wrong with the worksets. Try syncing and releaseing your model and then creating a new cache by opening from central.
Let me know if this doesn’t solve the problem. This is such an odd issue
I left the test files (*.rvt and *.gh), i’ve used for this post, below. Maybe you could try this on your machine and check if this works? I’ve got the latest BETA version of Rhino and the most recent Revit 2020.2
Okay. Seems like RIR is not playing well with the transaction that is inside the script for some reason. I modified the script to use the RIR queue for execution. See the guide