Quantcast
Channel: All Revit API Forum posts
Viewing all articles
Browse latest Browse all 66666

SEHException on CheckoutElements?

$
0
0

Why might WorksharingUtils.CheckOutElements() throw System.Runtime.InteropServices.SEHException: {"External component has thrown an exception."}  I think this has something to do with going back and forth between managed and non-managed so this may be a foolish thought but the documentation doesn't mention this exception as possibly being thrown from CheckoutElements().  (I confess that SEH isn't a strong suit in my .NET knowledge)

 

Background:

I've run right up against the fact that updaters are called on modified elements BEFORE Revit determines that the element cannot be edited because it is updated in the central model.  So my updaters are firing and updating my lists but the change never actually happens so things go haywire and my lists are off by an element count.

 

In an attempt to work around this issue, I thought it might be smart to check to see if the element could be checked out and if so, was its model update status suitable for editing.  However, when I try to check this element out, CheckoutElements() is throwing a structured exception handler exception

 

System.Runtime.InteropServices.SEHException occurred
  HResult=-2147467259
  Message=External component has thrown an exception.
  Source=RevitDBAPI
  ErrorCode=-2147467259
  StackTrace:
       at WorksharingUtils.checkoutElements(SetReturn<ElementId\,std::less<ElementId>\,tnallc<ElementId> >* , ADocument* , Set<ElementId\,std::less<ElementId>\,tnallc<ElementId> >* )
       at Autodesk.Revit.Proxy.DB.WorksharingUtilsProxy.CheckoutElements(DocumentProxy document, ICollection`1 elementsToCheckout)
  InnerException:

 

I think this could be related to running two users in one Revit session, or could be related to attempting to checkout elements in an updater?  Just need some ideas on where to start figuring this out.

 

I'm catching the exception but don't know what else to do other than determine that it can't be edited so I'm sometimes updating my internal lists and sometimes not...

 

If there are no ideas, I'll work on setting up a minimally reproducible case.

 

Thanks,

-Ken

 


Viewing all articles
Browse latest Browse all 66666

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>