Message 1 of 5
AutoCAD crashes when starting from Revit API

Not applicable
02-04-2016
08:03 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have a simple Revit addin setup where the users selects a linked dwg and the addins opens tha dwg in autocad to edit. However whenever I start AutoCAD from within the Revit addin I get the error "Unhandled Exception C0000005 (Access Violation Reading 0x0008) at address CADE4A58h".
Even this simple code gives me the error:
using Autodesk.Revit.DB; using Autodesk.Revit.UI; using Autodesk.Revit.Attributes; namespace ClassLibrary1 { [TransactionAttribute(TransactionMode.Manual), RegenerationAttribute(RegenerationOption.Manual)] public class Class1 : IExternalCommand { public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements) { System.Diagnostics.Process.Start(@"C:\test.dwg"); return Result.Succeeded; } } }
Just to be clear. If I double click the DWG file in windows explorer the file opens just fine without error. If I create a console application outside of the Revit API with just the process start command, the DWG opens just fine. IE
using System; using System.Diagnostics; namespace startautocad { class Program { static void Main(string[] args) { Process.Start(@"C:\test.dwg"); } } }
Any idea why I get the error in the Revit addin?