- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am developing a .Net (windows form) application which will be called by a command from autocad.
The task is looking through all entities in the model and select specific polygons. This is sort of a heavy task, so I am having the UI freezed for minutes which is not suitable. Thus I tried run the task in seperate thread: starting a transaction, getting objects and check some of their properties.
Now, it works fine with one transaction , but if I use more than one transaction the app fails randomly. The stack shows error on this call:
".. Autodesk.AutoCAD.Runtime.Interop.CheckNull(IntPtr returnValue)
at Autodesk.AutoCAD.ApplicationServices.TransactionManager.StartTransaction()"
or when Autocad tries to Dispose the transaction object. ( I'm using USING block for strating transaction, therefore not calling Dispose method in the code.)
but these error never happenes in single-thread mode.
Can you please help me to understand the reason and find a solution ?
Or what else can one do to make UI responsive when a time-consuming task is running?
Thanks,
ali
Solved! Go to Solution.