Modify Revit doc from Rhino Inside via python error

I am getting this error when I am trying to modify the document from ghpython in RiR.

I was simply modifying some of the sample code. Strangely, there was no error for the 32nd line (making a copy of the sphere) and it was executed, but it threw an error for the 33rd line even though both involves modifying and some sort of transaction with the document.

1 Like


It is still not possible to run this from GhPython, I’m on this as well as making breakpoints in Rhino Python Editor work.

The sample was mean to be run from the Rhino Python Editor.
I added your changes there and it works running from there.

I will tell you here when this is possible, that I hope maybe soon.


Thanks for the updates.


We finally have an installer here and what you were trying should work on that version.

Try running there for instance or any script you had in mind.

Hope it works as you expected.
Tell me if is not the case.

Do I need to remove the addin and dll files before installing it again?

To be sure you don’t have newest files that those that come in the installer, yes please remove the .addin .dll an .pdb files.


Thanks for all the great updates. it works smoothly now!

Hi Everyone,
I have a problem with GHPython and the Revit API.

I copy the sample7 in a GHPython script, I let it run and it works the first time, then if I delete the sphere in Revit 2020 and try to run the script a second time GH throws me this error:

“Runtime error (InvalidOperationException): Starting a transaction from an external application running outside of API context is not allowed.”

do you have any hint?

Have a nice day

I reply to myself since I solved my error.

The problem is that if you have the GHPython “IDE” open and click on the Revit workspace, GH will be closed, but you will still see the GHPython “IDE” and can go on working on the script.
In this situation if you click on test, Revit consider it as an external call to the API and throws an error message.

Have a nice day

1 Like

Thanks for pointing this out.
I will try to fix it next release.