I have created a small reproducible sample, please find attached.We were ready to release our next version of software and one of the developers updated to Release 2 and found this issue, it does not appear in Release 1.It appears to be when a polyfacemesh is put into a cell. Drawing the mesh outside of a cell works fine. We can also draw other geometry within a cell and that works fine. It appears to be the combination of a polyfacemesh within a cell.Building the example:I have included the built dlls if you wanted to run them directly, or to build them yourself make sure the configuration is set to "Debug - Connect" and Platform "x64".Reproducible steps:1. Load the TestProject dll into OpenRoads Designer 2021 Release 2 (my specific version is 10.10.20.78).2. Key-in "DrawWithNoCells". This will draw the meshes outside of a cell, which works fine. Zooming to extents will show the mesh.3.Delete the drawn meshes from the model4. Key-in "DrawCell1". This will draw a polyfacemesh in a cell.5. At this point, interacting with the drawn cell (selecting, moving) will likely cause the "Access Violation Exception"6. If it does not, Key-in "DrawCell2"I have also included a screen recording of the issue. https://autode.sk/3Kc9jaz
5315.Microstation.Release2Crash.Sample.zip
Hi Joe,
We detected that the AppendToCellOfCurrentElement() method, used in your code, has a potential to crash.
I see your project has a native component (LowLevel.dll). As a workaround, try to use unmanaged code to add the PolyfaceMesh to the cell.
I hope it helps.
Hi Henrique. I work at the same company as Joe, thanks for your response and help so far. Joe's sample is a heavily simplified version of the workflow within our product. We tried your suggestion of replacing the AppendToCellOfCurrentElement with the unmanaged equivalent but unfortunately it did not resolve it for us.
The exception that we're seeing is an AccessViolationException, due to the nature of this it is very random and difficult to narrow it down any further and is causing us a lot of lost time and frustration.
We are using a heavy mixture of the .NET and MDL APIs. When you say that you found an issue that may cause a crash, is it possible this issue may affect any of the other .NET methods? I must stress that we are not experiencing any issues in OpenRoads 2021 Release 1, this is only related to Release 2.
Thanks again, I hope you're able to assist.
Hi Chris,
Are you appending the elements to the cell using unmanaged code? Have you removed all calls to AppendToCellOfCurrentElement() method from your code?
Could you send me the code you are using (after the change) so I can test it here?
This issues was introduced in the Release 2. That's why it works in Release 1.
Regards,
Henrique
Hi Henrique,
Just to clarify, changing AppendToCellOfCurrentElement to the mdl equivalent did indeed fix that issue. However, we are now getting crashes in other areas of the API; due to the nature of AccessViolationExceptions, it is difficult to pinpoint exactly which calls are producing them.
We heavily use the .NET COM, mdl and .Net API's, and our software adds about 900 different key-ins. Could the issue that you spoke of affect other areas of the COM wrapper?It took roughly a week for us last time, to rule out anything that we had done, diagnose the issue with mesh's within blocks and produce a sample that showed the issue. I do not want to have to do that again to diagnose other similar issues introduced with Release 2.
Kind Regards,
Joe Houghton
Hi Henrique, are you able to provide any kind of update please after Joe's comment as it's still quite a problem for us? I have noticed this issue reported by someone else that may be connected to our problem.
Chris