question

Afonso Silva avatar image
0 Likes"
Afonso Silva asked Logan Gold commented

Difficulty setting up Flexsimpy

I'm trying to understand the following steps about setting up Flexsimpy:

1717687463384.png

I need to know what should be done exactly because i have little experience with visual studio. So could someone tell me the exact steps to do this set up, so I undersand? It would be a great help to explain to me the "Open the FlexSimPy.sln solution in visual studio"

FlexSim 24.1.0
developmentflexsimpyvisual studio
1717687463384.png (73.4 KiB)
· 4
5 |100000

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

Jason Lightfoot avatar image Jason Lightfoot ♦♦ commented ·

What is your goal? If you're just trying to call a python function from FlexSim and you have a supported version installed then you don't need to do any of that.

0 Likes 0 ·
Afonso Silva avatar image Afonso Silva Jason Lightfoot ♦♦ commented ·
Well I want read a file with pre programed commands using a python code and then translate it to FlexSim. Is there an easier way to do that?


0 Likes 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦♦ Afonso Silva commented ·
What event is instigating this? If it's FlexSim then just have FlexSim call a python function to read the file and return the content to FlexSim in your preferred format.
0 Likes 0 ·
Logan Gold avatar image Logan Gold ♦♦ commented ·

Hi @Afonso Silva, was Jordan Johnson'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 ·

1 Answer

Jordan Johnson avatar image
1 Like"
Jordan Johnson answered

Some of the resources we provide (such as FlexSimPy) are designed for an audience with some development experience. Considering your current level of experience, I would recommend a different path.

As @Jason Lightfoot points out, there are other ways you can work with FlexSim in Python:

  • You can call Python commands from a FlexSim model
  • You can launch FlexSim as a separate process with code like subprocess.Popen()
    • flexsim.exe [model path] [options]
    • "path/to/flexsim.exe" "path/to/model.fsm" /myflag 1
  • You can read command line values in FlexSim
    • if (commandlineparam("myflag") == "1") { do something }
  • You can read/write files in FlexSim.
    • It is common to write a file using Python and read that file in FlexSim.
  • You can run a script from the command line: /maintenance runscript /scriptpath "path/to/script.txt"
  • You can add code to the OnModelOpen trigger for a given model.

Maybe the above options will give you some ideas. It seems likely that you'll be able to accomplish your goal using those tools.

5 |100000

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