question

Patrick Cloutier avatar image
1 Like"
Patrick Cloutier asked Dirk Boumans commented

How to capture view in code ?

Hello, I'm trying to capture model views as the model is running.

I put this code in a User Event:

viewtofile(node("VIEW:/active/ortho"),modeldir() + "CapturedView1.bmp");

pt("captured");

The word captured appears in the output console but no file is created anywhere. I searched the entire computer for a file named as I did and there is none.

What am I doing wrong?

FlexSim 18.2.2
capture view
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
1 Like"
Phil BoBo answered Dirk Boumans commented

node("VIEW:/active/ortho") probably is NULL. You need a correct path to the view you want to capture.

Try using activedocumentnode() instead.

· 6
5 |100000

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