SEHException when CreatingGroup during Updater
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
We got a function that generates 2D symbols for Rebars in Revit. They Consist of FamilyInstances and DetailLines.
All Elements that is created for each Rebar is grouped and the GroupID is stored as a Parameter on the Rebar.
Each time the command is run, it deletes the Group stored on the Rebar Parameter and re-creates everything that's needed.
Running the function manually it works perfectly but when called from an Updater it crashes on the following line:
Group grp = view.Document.Create.NewGroup(collectionToGroup);
With the following Exception:
System.Runtime.InteropServices.SEHException occurred
HResult=-2147467259
Message=External component has thrown an exception.
Source=RevitAPI
ErrorCode=-2147467259
StackTrace:
at ElementGroupType.createBackup(ADocument* , ElementId , Boolean* , ElementId )
at Autodesk.Revit.Creation.ItemFactoryBase.NewGroup(ICollection`1 elementIds)
at AECAB.Structure.Rebar2D.RebarHelperFunctions.Add2DDetalingToRebar(Element el, View view, DetailCurve& MainRebarCurve, Settings settings) in C:\tfs\AECPlus\Revit\2017\Kod\AECABStructual\Rebar2D\HelperFunctions\RebarHelperFunctions.cs:line 658
InnerException:
Is this a bug in Revit or am I missing something?