
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello Everyone,
I am a Revit addins developer. One of my Winform c# addins, I am facing runtime Exception while implementing Async method. Below is the detail description of my issue
There is one method which is call from Winform button click event. Inside that method I am implementing Revit API call to modify the document and for that I am using Revit Transaction. Now I want that method to be run in background so for that I have to make that method Async. When I convert that regular method to async, Revit document automatically set as read only inside that method and when I try to start the transaction it throws an exception.
Exception thrown: 'Autodesk.Revit.Exceptions.InvalidOperationException' in RevitAPI.dll
Additional information: Cannot modify the document for either a read-only external command is being executed, or changes to the document are temporarily disabled.
Note: I am using Revit API 2015 dll and dot Net framework 4.5. Please suggest me the solution which is inside this scope.
I also want to implement cancel button which stop the Async process any point of a time. I am appreciate if any of you suggest me the solution of this issue.
Solved! Go to Solution.