The ability to connect FlexSim and Python looks really cool so I decided to make a simple test case. Rather than controlling FlexSim from Python I first decided to see if I can call a function from FlexSim.
I created a Test.fsm model and put a simple Python script in FlexSimPy\FlexSimPy.py. But when I try to call the Python function I get
exception: Code Binding Error: could not bind to function Node: /Tools/UserCommands/Add/code Binding string: external python "FlexSimPy/FlexSimPy" "add" Windows Error Code : 126
As far as I can see code 126 means missing DLL, but according to the GitHub documentation,
The PyConnector project implements the ability to bind the evaluation of nodes in FlexSim's tree to the evaluation of python functions. The project is implemented to work with python versions 3.7, 3.8, 3.9 and 3.10. The output DLLs from this project are included in the installed version of FlexSim.
(emphasis mine) and I found the DLLs in program\python so I assumed this should work out of the box.
I set the Python version in Global Preferences and made sure that python.exe is on my path. What am I missing? :-)