question

Jacob E2 avatar image
0 Likes"
Jacob E2 asked Jacob E2 commented

Show Dashboard Charts in 3D Model Space *FlexSim 2022*

Hello,

I am trying to display dashboard charts in the 3D model view which was done in this question in 2018: Show State Pie and Statistics in 3D Model?

When I run the model in @Phil BoBo 's answer, (render-stats-test (5).fsm) FlexSim crashes every time the dashboard tried to update. Is this method not compatible with FlexSim 2022, or do I need to modify the custom code somehow? Is there a better way to accomplish this? Phil mentioned back in 2018 that it was on the dev list to create an easier way to do this, but I'm not aware of any.

Thanks,
Jacob

FlexSim 22.0.1
dashboardsstatistics
5 |100000

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

1 Answer

·
Phil BoBo avatar image
0 Likes"
Phil BoBo answered Jacob E2 commented

Thanks for pointing this out. This is a bug with the unloadimage() command that was introduced when we made our media load multi-threaded in FlexSim 20.2.

I'll add a case to the dev list to fix this.

As a workaround, you can call bindtexture() before calling unloadimage() in order to ensure that the texture is finished loading before trying to unload it. Modify the custom code in the Render Dashboard To Texture activity:

1650383792192.png

int textureid = gettextureindex(modeldir() + "test.png");
bindtexture(textureid);
unloadimage(textureid);

1650383792192.png (381.5 KiB)
· 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.

Jacob E2 avatar image Jacob E2 commented ·
Excellent! Thank you, Phil!
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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