<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Using FlexSim with Python/C api in FlexSim Forum</title>
    <link>https://forums.autodesk.com/t5/flexsim-forum/using-flexsim-with-python-c-api/m-p/13533499#M41864</link>
    <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;&lt;A rel="user" href="https://answers.flexsim.com/users/206/phil.b.html" nodeid="206"&gt;@Phil BoBo&lt;/A&gt;, thank you for your reply. This is going to take sometime for me to create the environment on my PC. In the customer side, they are using their original AI engine, so we don't know how they are created. I just know that they are using Python and want to access to FlexSim with Python. The sample I would like is to test how we can pass parameter value defined in Python to "Processor's process time" for example as a proof.&lt;/P&gt;&lt;/DIV&gt;</description>
    <pubDate>Tue, 20 Oct 2020 05:52:45 GMT</pubDate>
    <dc:creator>sakamoto_ryosuke</dc:creator>
    <dc:date>2020-10-20T05:52:45Z</dc:date>
    <item>
      <title>Using FlexSim with Python/C api</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/using-flexsim-with-python-c-api/m-p/13533497#M41862</link>
      <description>&lt;P&gt;&lt;I&gt;[ FlexSim 20.2.2 ]&lt;/I&gt;&lt;/P&gt;&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;Hello! After having discussion with one of your colleague, I have found out that you can use python in FlexSim by Python/C API. However, to confess, I'm not fond in this field. Do you have any kind of manual or note to integrate Python/C to FlexSim? I'd really appreciate if you can also provide some kind of sample project, model,etc. Thank you in advance.  &lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Sun, 18 Oct 2020 09:53:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/using-flexsim-with-python-c-api/m-p/13533497#M41862</guid>
      <dc:creator>sakamoto_ryosuke</dc:creator>
      <dc:date>2020-10-18T09:53:54Z</dc:date>
    </item>
    <item>
      <title>Re: Using FlexSim with Python/C api</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/using-flexsim-with-python-c-api/m-p/13533498#M41863</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;Download the Module SDK from the Account section of the website. Follow its embedded documentation on how to use it to create a FlexSim Module and compile a module dll.&lt;/P&gt;&lt;P&gt;Once you can compile a module dll, follow the instructions at &lt;A rel="noopener noreferrer" href="https://docs.python.org/3/extending/embedding.html" target="_blank"&gt;https://docs.python.org/3/extending/embedding.html&lt;/A&gt; for executing Python from C++ code.&lt;/P&gt;&lt;P&gt;When you install Python, it includes a bunch of header files (including Python.h), lib files (including python3.lib), and dlls (including python3.dll). You will use these in your Module DLL project to interact with Python.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="33492-1603121043564.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1503934i610C1C5E59EEDE13/image-size/large?v=v2&amp;amp;px=999" role="button" title="33492-1603121043564.png" alt="33492-1603121043564.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;You are unlikely to find someone who has already done this and can share a sample project/model because executing Python from C is rarely helpful. Most 3rd party code libraries are already written in C or C++, so you can connect directly to them. Usually those libraries have Python wrappers so that you can call them from Python. If you are already in C++, then you don't need to use Python wrapper libraries. You can call them directly from C++ instead of going from C++ to Python back to C.&lt;/P&gt;&lt;P&gt;Is there a particular library that you are trying to use, or is this simply an academic exercise to see what is possible?&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 19 Oct 2020 15:24:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/using-flexsim-with-python-c-api/m-p/13533498#M41863</guid>
      <dc:creator>philboboADSK</dc:creator>
      <dc:date>2020-10-19T15:24:12Z</dc:date>
    </item>
    <item>
      <title>Re: Using FlexSim with Python/C api</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/using-flexsim-with-python-c-api/m-p/13533499#M41864</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;&lt;A rel="user" href="https://answers.flexsim.com/users/206/phil.b.html" nodeid="206"&gt;@Phil BoBo&lt;/A&gt;, thank you for your reply. This is going to take sometime for me to create the environment on my PC. In the customer side, they are using their original AI engine, so we don't know how they are created. I just know that they are using Python and want to access to FlexSim with Python. The sample I would like is to test how we can pass parameter value defined in Python to "Processor's process time" for example as a proof.&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 20 Oct 2020 05:52:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/using-flexsim-with-python-c-api/m-p/13533499#M41864</guid>
      <dc:creator>sakamoto_ryosuke</dc:creator>
      <dc:date>2020-10-20T05:52:45Z</dc:date>
    </item>
    <item>
      <title>Re: Using FlexSim with Python/C api</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/using-flexsim-with-python-c-api/m-p/13533500#M41865</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;Wanting to access FlexSim from Python is very different than wanting to use/integrate Python in FlexSim. Python is a programming language, and FlexSim is an application.&lt;/P&gt;&lt;P&gt;You can communicate with FlexSim from Python using IPC (inter-process communication) technologies, such as sockets or the FlexSim WebServer.&lt;/P&gt;&lt;P&gt;See &lt;A rel="noopener noreferrer" href="https://docs.python.org/3/howto/sockets.html" target="_blank"&gt;https://docs.python.org/3/howto/sockets.html&lt;/A&gt; for documentation on using sockets with Python.&lt;/P&gt;&lt;P&gt;See &lt;A rel="noopener noreferrer" href="https://archive.flexsim.com/threads/thread3186.html" target="_blank"&gt;https://archive.flexsim.com/threads/thread3186.html&lt;/A&gt; for FlexSim client and server socket examples using FlexScript.&lt;/P&gt;&lt;P&gt;In addition to the FlexScript socket commands, you could also use the DLL Maker or Module SDK to write your own C++ socket code if you want direct access and control over exactly what is happening.&lt;/P&gt;&lt;P&gt;If you just want to call FlexSim from Python and set values, such as a processor's processing time, you can run the FlexSim application from Python and pass it command-line arguments, such as FlexScript code to execute. See &lt;A rel="noopener noreferrer" href="https://answers.flexsim.com/answers/21375/view.html" target="_blank"&gt;https://answers.flexsim.com/answers/21375/view.html&lt;/A&gt; and &lt;A rel="noopener noreferrer" href="https://docs.python.org/3/library/subprocess.html" target="_blank"&gt;https://docs.python.org/3/library/subprocess.html&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;If you want to communicate repeatedly with an already-open FlexSim, then you'll need to use some method of IPC, such as using sockets for a direct connection or using the FlexSim WebServer for communication over HTTP.&lt;/P&gt;&lt;P&gt;See &lt;A rel="noopener noreferrer" href="https://docs.python.org/3/library/http.client.html" target="_blank"&gt;https://docs.python.org/3/library/http.client.html&lt;/A&gt; for Python documentation about communicating with a server via HTTP and &lt;A rel="noopener noreferrer" href="https://docs.flexsim.com/en/20.2/Reference/DeveloperAdvancedUser/Webserver/#custom" target="_blank"&gt;https://docs.flexsim.com/en/20.2/Reference/DeveloperAdvancedUser/Webserver/#custom&lt;/A&gt; for documentation on responding to custom web queries using the FlexSim WebServer.&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 20 Oct 2020 13:45:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/using-flexsim-with-python-c-api/m-p/13533500#M41865</guid>
      <dc:creator>philboboADSK</dc:creator>
      <dc:date>2020-10-20T13:45:49Z</dc:date>
    </item>
    <item>
      <title>Re: Using FlexSim with Python/C api</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/using-flexsim-with-python-c-api/m-p/13533501#M41866</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;&lt;A rel="user" href="https://answers.flexsim.com/users/19900/ryosukes.html" nodeid="19900"&gt;@Ryosuke S&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;Please also see the following library and youtube video:&lt;/P&gt;&lt;P&gt;&lt;A rel="noopener noreferrer" href="https://pybind11.readthedocs.io/en/stable/" target="_blank"&gt;https://pybind11.readthedocs.io/en/stable/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A rel="noopener noreferrer" href="https://www.youtube.com/watch?v=-eIkUnCLMFc" target="_blank"&gt;https://www.youtube.com/watch?v=-eIkUnCLMFc&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Also consider passing information using a database.&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 20 Oct 2020 14:53:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/using-flexsim-with-python-c-api/m-p/13533501#M41866</guid>
      <dc:creator>benjamin_w2</dc:creator>
      <dc:date>2020-10-20T14:53:59Z</dc:date>
    </item>
    <item>
      <title>Re: Using FlexSim with Python/C api</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/using-flexsim-with-python-c-api/m-p/13533502#M41867</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;&lt;A rel="user" href="https://answers.flexsim.com/users/206/phil.b.html" nodeid="206"&gt;@Phil BoBo&lt;/A&gt;, Thank you for your reply. Great! It's nice to know there are several ways. So then, which one do you suggest? The most simplest way to accomplish what I want to do for now. Also, I would like to know what I need to install to my pc, what procedure I need to take to accomplish it. I have gone through the python docs, but are not helpful enough for a beginner. I don't nee any fancy document, but a note describing steps  when you tried on your side perhaps? Thank you in advance.&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 20 Oct 2020 15:10:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/using-flexsim-with-python-c-api/m-p/13533502#M41867</guid>
      <dc:creator>sakamoto_ryosuke</dc:creator>
      <dc:date>2020-10-20T15:10:41Z</dc:date>
    </item>
    <item>
      <title>Re: Using FlexSim with Python/C api</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/using-flexsim-with-python-c-api/m-p/13533503#M41868</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;If you just want to start a FlexSim process with particular inputs, run the model, and get the outputs at the end of the run, I would call FlexSim with command line parameters.&lt;/P&gt;&lt;P&gt;If you want to start FlexSim, run the model partially, pause the model, send information back and forth, resume the model, etc., then I would use sockets.&lt;/P&gt;&lt;P&gt;I don't have a step-by-step document for beginners with exact steps on how to do exactly what you want. To make such a document, you need to actually &lt;EM&gt;do &lt;/EM&gt;what you want and document what you did.&lt;/P&gt;&lt;P&gt;If in attempting to use the provided FlexSim and Python documentation to do what you want, you run into a particular, specific problem, then post a new question detailing what you've done, what you expected to happen, and what actually happened, and we might be able to explain why and suggest ways to overcome that specific issue. But your questions right now are generic, so you are only going to get generic answers. If you want specifics, then start actually doing it so that you can ask specific questions.&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 20 Oct 2020 15:39:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/using-flexsim-with-python-c-api/m-p/13533503#M41868</guid>
      <dc:creator>philboboADSK</dc:creator>
      <dc:date>2020-10-20T15:39:43Z</dc:date>
    </item>
    <item>
      <title>Re: Using FlexSim with Python/C api</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/using-flexsim-with-python-c-api/m-p/13533504#M41869</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;&lt;A rel="user" href="https://answers.flexsim.com/users/206/phil.b.html" nodeid="206"&gt;@Phil BoBo&lt;/A&gt;, &lt;A rel="user" href="https://answers.flexsim.com/users/13461/benjaminw2.html" nodeid="13461"&gt;@Benjamin W2&lt;/A&gt; Thank you for all your help, we were able to integrate flexsim with python. &lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 13 Nov 2020 07:39:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/using-flexsim-with-python-c-api/m-p/13533504#M41869</guid>
      <dc:creator>sakamoto_ryosuke</dc:creator>
      <dc:date>2020-11-13T07:39:40Z</dc:date>
    </item>
    <item>
      <title>Re: Using FlexSim with Python/C api</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/using-flexsim-with-python-c-api/m-p/13533505#M41870</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;&lt;A rel="user" href="https://answers.flexsim.com/users/19900/ryosukes.html" nodeid="19900"&gt;@Ryosuke S&lt;/A&gt; Hello, we have the same question about how to integrate flexsim with Python, and we know that you've solved it. Could you please tell us the solutions or give some notes. Thank you so much!&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Sat, 21 May 2022 08:17:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/using-flexsim-with-python-c-api/m-p/13533505#M41870</guid>
      <dc:creator>jing_69</dc:creator>
      <dc:date>2022-05-21T08:17:55Z</dc:date>
    </item>
    <item>
      <title>Re: Using FlexSim with Python/C api</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/using-flexsim-with-python-c-api/m-p/13533506#M41871</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;Some resources from the latest version:&lt;P&gt;&lt;A href="https://docs.flexsim.com/en/22.1/Reference/DeveloperAdvancedUser/ControllingFlexSimExternally/ControllingFlexSimExternally.html#python"&gt;Controlling FlexSim Externall&lt;/A&gt;y&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.flexsim.com/en/22.1/Reference/DeveloperAdvancedUser/ConnectingToExternalCode/ConnectingToExternalCode.html#python"&gt;Connecting to External Code&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.flexsim.com/en/22.1/ModelLogic/ReinforcementLearning/KeyConcepts/KeyConcepts.html#configuringenvironment"&gt;Key Concepts About Reinforcement Learning&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.flexsim.com/en/22.1/ModelLogic/ReinforcementLearning/Training/Training.html"&gt;Reinforcement Learning Training&lt;/A&gt;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Sat, 21 May 2022 09:09:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/using-flexsim-with-python-c-api/m-p/13533506#M41871</guid>
      <dc:creator>jason_lightfoot_adsk</dc:creator>
      <dc:date>2022-05-21T09:09:44Z</dc:date>
    </item>
    <item>
      <title>Re: Using FlexSim with Python/C api</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/using-flexsim-with-python-c-api/m-p/13533507#M41872</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;&lt;A rel="user" href="https://answers.flexsim.com/users/37958/jing-69.html" nodeid="37958"&gt;@Jing_69&lt;/A&gt; hello! as in &lt;A rel="user" href="https://answers.flexsim.com/users/226/jason.l.html" nodeid="226"&gt;@Jason Lightfoot&lt;/A&gt; reply, now that in FlexSim2022, we  have ui for reinforcement learning, I think you should use this, because what we have done is almost similar to this.&lt;/P&gt;&lt;P&gt;Thanks to the FlexSim development team, that this feature is available now.&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Sun, 22 May 2022 23:49:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/using-flexsim-with-python-c-api/m-p/13533507#M41872</guid>
      <dc:creator>sakamoto_ryosuke</dc:creator>
      <dc:date>2022-05-22T23:49:12Z</dc:date>
    </item>
    <item>
      <title>Re: Using FlexSim with Python/C api</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/using-flexsim-with-python-c-api/m-p/13533508#M41873</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 &lt;A rel="user" href="https://answers.flexsim.com/users/226/jason.l.html" nodeid="226"&gt;@Jason Lightfoot&lt;/A&gt; 
 &lt;A rel="user" href="https://answers.flexsim.com/users/19900/ryosukes.html" nodeid="19900"&gt;@Ryosuke S&lt;/A&gt; Thank you so much for your reply!
&lt;/DIV&gt;</description>
      <pubDate>Mon, 23 May 2022 02:24:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/using-flexsim-with-python-c-api/m-p/13533508#M41873</guid>
      <dc:creator>jing_69</dc:creator>
      <dc:date>2022-05-23T02:24:29Z</dc:date>
    </item>
  </channel>
</rss>

