Exception: OnPaint() Any thoughts?

Exception: OnPaint() Any thoughts?

patricia_brenny_r
Not applicable
69 Views
4 Replies
Message 1 of 5

Exception: OnPaint() Any thoughts?

patricia_brenny_r
Not applicable

[ FlexSim 23.2.0 ]

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

0 Likes
Accepted solutions (1)
70 Views
4 Replies
Replies (4)
Message 2 of 5

kavika_faleumu
Autodesk
Autodesk
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
Message 3 of 5

patricia_brenny_r
Not applicable

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
Message 4 of 5

JordanLJohnson
Autodesk
Autodesk
Accepted solution

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.

.


Jordan Johnson
Principal Software Engineer
>

Message 5 of 5

patricia_brenny_r
Not applicable
Thank you!