FluidGenerator setting by using flexscript

FluidGenerator setting by using flexscript

danielhsu2014
Contributor Contributor
140 Views
3 Replies
Message 1 of 4

FluidGenerator setting by using flexscript

danielhsu2014
Contributor
Contributor

[ FlexSim 24.2.0 ]

1736239774645.png

How can I set the Refill Mode and Refill Rate for a Source object in FlexSim using FlexScript, similar to how I set the maximum content with setvarnum(newObj, "maxcontent", 10);?

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

SebastianCanasV
Collaborator
Collaborator
Accepted solution

Hey @Daniel ,

You can use:

// Refill Mode: 1 Continuous Refill - 2 Complete Refill When empty
setvarnum(newObj, "refillmode", 1 /*1 or 2*/) 
//Refill Rate
setvarnum(newObj, "refillrate", value)


0 Likes
Message 3 of 4

danielhsu2014
Contributor
Contributor

Thank you so much. How about output port, How can I set the maximum object and maximum port rate in flexscript? Thank you for your help!

0 Likes
Message 4 of 4

SebastianCanasV
Collaborator
Collaborator

@Daniel ,

// Output ports - Maximum Object
setvarnum(newObj, "maxobjectoutrate", value);
// Output ports - Maximum Port Rate
setvarnum(newObj, "maxportoutrate", value);
0 Likes