question

Wesley avatar image
0 Likes"
Wesley asked Logan Gold commented

How pass the values ​​(parameters) from python into Flexsim?

3D model is not assembled, but I intend to pass the values (parameters) from python into Flexsim. How do I do this?

Initially, I did the following test:

setParameter.gif

where is my error? What should I do?



FlexSim 23.1.0
flexsimpy
setparameter.gif (6.1 MiB)
· 2
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

Patricia_brenny R avatar image
0 Likes"
Patricia_brenny R answered

I need some more background information to optimize this reply:

- Have you followed the steps to set up the FlexSimPy library correctly?
- What model are you running this script with? Could you send the model and the code to help me understand better?

Steps to Ensure Correct Setup and Parameter Passing

0. (IMPORTANT) Follow the build tutorial provided by FlexSimPy Documentation to correctly allow FlexSimPy to work on your flexsim distribution https://github.com/flexsim/FlexSimPy/blob/master/README.md


1. Ensure that FlexSimPy is installed correctly on python and the syntax is correct in your import

2. Define the parameters you intend to use in your FlexSim model before running your Python script.

3. Ensure these parameters are modifiable and can be accessed.

4. Follow the correct signature for function calls.

Important Points to Ensure

- Ensure all paths are correct before initializing your controller.
- Ensure the parameter names used in your Python script match those in the FlexSim model exactly.
- Make sure the FlexSim model is in a state where it can accept parameter changes (not running or paused if it should be stopped).
- Verify that the controller object is correctly initialized and connected to FlexSim.

By following these steps and ensuring the details are correct, you should be able to pass parameters from Python to FlexSim effectively. Please provide more details about your model and script if you encounter specific issues.

5 |100000

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