-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
QOpenForRead returning closed objects? #1
Comments
Thank you for raising this concern. The |
According to Autodesk, the objects that were opened using
I agree it works anyway, and I haven't had any problems until I start processing a large amount of dynamic blocks. It is possible that my problems derive from something else, but I just want to make sure this is not the issue. |
My guess is this description in the documentation was inherited from the C++ ObjectARX. In ObjectARX, objects opened with transactions share same address space with the AutoCAD kernal. This is obviously not the case in managed .NET application, where opened objects are just copy. Nonetheless, I am happy to help solve any problems you may have. |
You can easily verify whether this is the issue by putting your read operation inside a transaction and see if the issue is gone. |
I tried using an overload for QOpenForRead that works as QOpenForWrite, but the mysterious error messages did not go away. So I am convinced my problems come from another source and this issue can be closed. But since you are offering help, would you mind take a look at my code if I put together a simplified VS solution? Perhaps via email (or channel of your choice), since its not relevant here anymore. |
You can send it to [email protected]. Also please share the AutoCAD version, and any test .dwg you are using. |
Updated Acad references from Nuget, Change to .Net 4.7.1
Thank you for this repo, it is awesome! However, I am experiencing stability issues when batch processing a large amount of blocks. I am suspecting that QOpenForRead can have part in this since they return a closed object:
The
using
statement will call to close the object before returning it, and it is no longer guaranteed that the object can be used. See this post on the Autodesk forum.The text was updated successfully, but these errors were encountered: