Error when sending in Revit

I am getting an error when sending from Revit.

Method GetSelectionFilterObjects threw an error of type Autodesk.Revit.Exceptions.ArgumentNullException

This only occurs when selecting the include linked files option. Sending by manually selecting or without the check selected is fine.

The last post about this issue is more than a year ago (Feb 2024) with nothing conclusive:

I have the most recent Speckle version for Revit : 2.21.5

This is the full error:

SendCommand failed - Method GetSelectionFilterObjects threw an error of type Autodesk.Revit.Exceptions.ArgumentNullException. Reason: The input argument "document" of function `anonymous-namespace'::FilteredElementCollector_constructor or one item in the collection is null at line 315 of file E:\Ship23.0.1\2023_px64\Source\Revit\RevitDBAPI\gensrc\APIFilteredElementCollectorProxy.cpp.
Parameter name: document
Speckle.Core.Logging.SpeckleException: Method GetSelectionFilterObjects threw an error of type Autodesk.Revit.Exceptions.ArgumentNullException. Reason: The input argument "document" of function `anonymous-namespace'::FilteredElementCollector_constructor or one item in the collection is null at line 315 of file E:\Ship23.0.1\2023_px64\Source\Revit\RevitDBAPI\gensrc\APIFilteredElementCollectorProxy.cpp.
Parameter name: document ---> Autodesk.Revit.Exceptions.ArgumentNullException: The input argument "document" of function `anonymous-namespace'::FilteredElementCollector_constructor or one item in the collection is null at line 315 of file E:\Ship23.0.1\2023_px64\Source\Revit\RevitDBAPI\gensrc\APIFilteredElementCollectorProxy.cpp.
Parameter name: document
   at ?A0xcce20d0d.FilteredElementCollectorProxy_constructor(Document document)
   at Speckle.ConnectorRevit.ConnectorRevitUtils.GetSupportedElements(Document doc, IRevitDocumentAggregateCache cache)
   at Speckle.ConnectorRevit.UI.ConnectorBindingsRevit.GetEverything(Dictionary`2 linkedDocs)
   at Speckle.ConnectorRevit.UI.ConnectorBindingsRevit.GetSelectionFilterObjects(ISpeckleConverter converter, ISelectionFilter filter)
   --- End of inner exception stack trace ---
   at Speckle.ConnectorRevit.UI.ConnectorBindingsRevit.GetSelectionFilterObjects(ISpeckleConverter converter, ISelectionFilter filter)
   at RevitSharedResources.Models.ExternalEventHandler`2.Execute(UIApplication app)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at RevitSharedResources.Models.APIContext.<Run>d__8`2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at RevitSharedResources.Models.APIContext.<Run>d__5`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Speckle.ConnectorRevit.UI.ConnectorBindingsRevit.<SendStream>d__128.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at DesktopUI2.ViewModels.StreamViewModel.<SendCommand>d__213.MoveNext() 

Side question:

Speckle.Core.Logging.SpeckleException: Conversion of Opening with id 2607799 (ToSpeckle) returned null
   at Speckle.ConnectorRevit.UI.ConnectorBindingsRevit.ConvertToSpeckle(Element revitElement, ISpeckleConverter converter)
   at Speckle.ConnectorRevit.UI.ConnectorBindingsRevit.<>c__DisplayClass128_0.<SendStream>b__2()

Why are there these errors and should I be concerned?

Hey @eugeneida, I appreciate the detailed info!

Quick clarification: you mentioned you’re on v2.21.5 — are you using the interface from the regular Speckle desktop app or Speckle Beta? (You can double-check by looking at the app name in your taskbar or start menu.)

I ask because the next-gen (Beta) is actively working on improved performance and has built-in workarounds for some of the trickier Revit API quirks, especially around linked files. If you’re not using Beta yet, I’d recommend trying it — you can run both side-by-side, but just between each other.

Also, thanks for raising the question about the Opening element error — those are conversion warnings that generally won’t block sends. But if they show up frequently or concern you, we can add them to our list of elements to review for improved handling.

Let me know if you want help setting up the beta version or if you can reproduce this in a smaller model you can share with us!

Hi Jonathon,

Thanks for the quick reply!

Yes I am on the regular desktop app now. I am trying to figure out how to set up the beta. I’ve went and clicked on Use beta versions of Manager option, but I am not sure if that does anything. How do I proceed?

Also, thanks for raising the question about the Opening element error — those are conversion warnings that generally won’t block sends. But if they show up frequently or concern you, we can add them to our list of elements to review for improved handling.

I am not sure what or what isn’t transmitted as I am not an architect, and I’m a software engineer by trade. By eyeballing it, it seems most stuff gets across fine but I’m not sure. I guess it would require an engineer or architect to go through the model to tell.

Let me know if you want help setting up the beta version or if you can reproduce this in a smaller model you can share with us!

Repro in a smaller model might be more difficult as we just get a model from the architects to send, and I suppose we would need to go through their portfolio and see what sticks, which, at this point, not so feasible for us.

Hey @eugeneida ,

If you install the latest version of Revit connector, next-gen beta connector gets installed automatically. You can see it next to the Speckle connector in the same tab. If you still don’t see it, you can download and install it from here.