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.

Logan Gold avatar image Logan Gold ♦♦ commented ·

Hi @Wesley, was Patricia_brenny R's answer helpful? If so, please click the "Accept" button at the bottom of their answer. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always comment back to reopen your question.

0 Likes 0 ·
Joerg Vogel avatar image Joerg Vogel commented ·

@Wesley, be a liitle more patient. It is hard, I know. You have asked an hour ago a question "How to pass one parameter..". Now you ask "how to pass many parameters..". Here are existing some recommendations to use this answers site. And one hint is not to ask many questions for one topic. Now the question is, what do you want to get an answer for first.

-1 Like -1 ·

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.