Hello Rhino Inside community,
i am trying to dissmiss a Revit Dialog and I found this link in the website of Dynamobim
The problem is, I have some troubles importing the same libraries, cause there are not being called exactly the same from Rhino.Inside, as far as I know.
Thanks in advance!
yes, it is revit 2019, thanks
Yeah, there is something about Revit 2019’s old Python engine cannot load libraries if Dynamo is loaded. I believe @Rickson and @eirannejad have more details on it.
I think it depends on the order of install and would cause the script to totally fail, which i don’t think its doing for you.
the relevant posts
my solution to that particular problem was to delete the dynamo addins.
I translated the sample from the forum to be Rhino.Inside like.
# Original code from:
__author__ = "kike.garbo"
__version__ = "2020.09.09"
from System import EventHandler
# Import RevitAPI
from Autodesk.Revit.DB import *
from Autodesk.Revit.UI import *
from Autodesk.Revit.UI.Events import *
# Import RiR
from RhinoInside.Revit import Revit
doc = Revit.ActiveDBDocument
uidoc = Revit.ActiveUIDocument
uiapp = uidoc.Application
def dismiss (sender, eventArgs):
if isinstance(eventArgs, TaskDialogShowingEventArgs):
outViews = 
for i in views:
Options = Autodesk.Revit.DB.NavisworksExportOptions()
Options.ExportScope = NavisworksExportScope.View
Options.ViewId = i.Id
Options.ExportLinks = True
dialogEventHandler = EventHandler[DialogBoxShowingEventArgs](dismiss)
uiapp.DialogBoxShowing += dialogEventHandler
doc.Export(path, RemoveFirstChar(i.Name), Options)
uiapp.DialogBoxShowing -= dialogEventHandler
with Transaction(doc, "Export Navisworks") as trans:
Export-NavisWorks.gh (13.8 KB)
I was unable to really test it on my computer since I don’t have Navisworks installed. Tell me if you have any trouble running the linked script above.
thanks a lot! I test it today and I give a feed back!