Message 1 of 7
Revit 2015 InternalException on CustomExporter with Linked Files
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
CustomExporter.export is crashing on Revit 2015 when run in a spearate thread when there are linked files in the scene. Works fine on Revit 2014.
The code to reproduce this is....
public class MyExportContext2 : IExportContext { public MyExportContext2() { } public void OnPolymesh(PolymeshTopology node) { } public void OnMaterial(MaterialNode node) { } public void Finish() { } public bool IsCanceled() { return false; } public void OnDaylightPortal(DaylightPortalNode node) { } public void OnLight(LightNode node) { } public RenderNodeAction OnLinkBegin(LinkNode node) { return RenderNodeAction.Proceed; } public void OnLinkEnd(LinkNode node) { } public void OnRPC(RPCNode node) { } public RenderNodeAction OnViewBegin(ViewNode node) { return RenderNodeAction.Proceed; } public void OnViewEnd(ElementId elementId) { } public RenderNodeAction OnFaceBegin(FaceNode node) { return RenderNodeAction.Proceed; } public void OnFaceEnd(FaceNode node) { } public RenderNodeAction OnElementBegin(ElementId elementId) { return RenderNodeAction.Proceed; } public void OnElementEnd(ElementId elementId) { } public RenderNodeAction OnInstanceBegin(InstanceNode node) { return RenderNodeAction.Proceed; } public void OnInstanceEnd(InstanceNode node) { } public bool Start() { return true; } }
and to call it....
class MyEventHandler : IExternalEventHandler { public void RunExporter() { MyExportContext2 m_ExportContext = null; m_ExportContext = new MyExportContext2(); CustomExporter exporter = new CustomExporter(HostManager.GetCurrentDocument(), m_ExportContext); View3D m_ActiveView = HostManager.GetCurrentDocument().ActiveView as View3D; exporter.Export(m_ActiveView); } public void Execute(UIApplication a) { if (!HostManager.IsCurrentView3dPerspective()) { SelectViewForm f = new SelectViewForm(); f.ShowDialog(); } Thread thread = new Thread(this.RunExporter); thread.Start(); } ...etc
Paul