question

Patricia_brenny R avatar image
0 Likes"
Patricia_brenny R asked Patricia_brenny R commented

Exception: OnPaint() Any thoughts?

Hello, have you guys ever encontered an OnPaint exception, when dealing with MeshAPI for example? I'm not sure it's directly related to Mesh but I the object that usually sends these exception was designed with Mesh. If you have any idea of what might be happening it would help me a lot, I've never seen this before.1690849320142.png

FlexSim 23.2.0
exception errormodule sdkdevelopmentexceptionflexsim exception
1690849320142.png (1.6 KiB)
· 2
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Kavika F avatar image Kavika F ♦ commented ·
Hey @Patricia_brenny R, is there a specific object that you get this error with? Or maybe some steps I could take to replicate the error you're getting? Thanks!
0 Likes 0 ·
Patricia_brenny R avatar image Patricia_brenny R Kavika F ♦ commented ·

We are updating some of the Rail code from the Railworks library, and this seems to be related to it.

The steps is the complicated part, we just open the model and move around a bit or reset it and that happens when there are rails in the model, seems to me to be something about onDraw, but not sure. it happens once also, then stops for a while.

0 Likes 0 ·

1 Answer

Jordan Johnson avatar image
2 Likes"
Jordan Johnson answered Patricia_brenny R commented

That exception is very general. FlexSim runs certain code whenever it paints the 3D view. Somewhere in all that logic something has gone wrong.

One common cause is that the tree is messed up, so that as your draw code is drawing objects that are linked to other objects, those links are broken. This happens frequently in process flow (which gives an OnDraw exception) when activity connections are messed up. The draw pass is trying to follow a connection and is assuming that the connection is valid, but an exception occurs instead.

So I'd say put some _ASSERT() statements in your code to check assumptions, especially if you are dereferencing pointers or casting pointers to other types.

· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Patricia_brenny R avatar image Patricia_brenny R commented ·
Thank you!
1 Like 1 ·