Change a Marks

Change a Marks

jean_baptiste_g
Not applicable
16 Views
2 Replies
Message 1 of 3

Change a Marks

jean_baptiste_g
Not applicable

[ FlexSim 18.0.3 ]

Hi all,

I need to change the Marks of a Tank depending in wich case I'm. If I want a Mid Mark = 12000L, 12000 is stored in a label. I know how to sample this value, but I can't sample the location of the Mid Mark, I only can sample the value of the Mid Mark. How can I do that ?

Thank you in advance for your answer.

0 Likes
Accepted solutions (1)
17 Views
2 Replies
Replies (2)
Message 2 of 3

clair_augsburgerZGWRZ
Collaborator
Collaborator
Accepted solution

Hello Jean-Baptiste,

I wonder from which field are you using the sampler. In the screenshot below I used the sampler from a script window and it provides several options:

11178-sample-mid-mark-2.png

getvarnum(model().find("FluidTank1"), "midmark") will return the value of the Mid Mark.

getvarnode(model().find("FluidTank1"), "midmark") will return the node where the Mid Mark is stored.

model().find("FluidTank1>variables/midmark") will also return the node where the Mid Mark is stored.

0 Likes
Message 3 of 3

axel_kohonen
Not applicable

Hi @Jean-Baptiste G

As Clair A suggests, use the sampler, but if you want to set the value instead of get it then use

setvarnum(...) instead of getvarnum(...)