Hi @vishweshgm
It is not possible to change parameters during runtime using a script.
If you know in advance when a parameter needs to be modified, you should implement the corresponding logic directly in your model. However, in some cases this is not feasible and the decision must be made “on the fly.”
When using scripting, the required workflow is to stop the simulation, save the states, modify the desired parameter, and then restart the simulation using the stored states.
An example of this approach can be found in the following forum post:
Co-Simulation with Scripting for Changing Thermal Parameters During Simulation
Although the example focuses on thermal simulations, the same workflow can be applied to any parameter that needs to be changed during simulation.
Hope this helps.