question

lancewu avatar image
0 Likes"
lancewu asked Jason Lightfoot edited

How to use visual studio link flexsim

Hi,guys

I found that after introducing the header file of flexsim and the library of flexsim in Visual Studio, I can use the following functions in Visual Studio:


//find node

Treenode tool=model() ->find ("Tools");

//Create processor

Createinstance (library() ->find ("? Processor"), model());

//Addgolabetable

FleximSm:: applicationcommand ("addglobaltable");



The function will not report an error, but it is useless because no model file is specified.

I want to know if there is a way for me to directly use visual studio to operate flexsim to achieve functionality.

Thank you for your review

FlexSim 22.1.4
c++viusal studio
· 1
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 ·

This post should be a comment to your original question which I am now closing.

0 Likes 0 ·

1 Answer

Jason Lightfoot avatar image
0 Likes"
Jason Lightfoot answered Jason Lightfoot edited

Please take a look at the documentation on connecting to external programs.

· 9
5 |100000

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

Jacob Gillespie avatar image Jacob Gillespie ♦ commented ·

@lancewu Maybe this is what you are looking for? CONTROLLING FLEXSIM EXTERNALLY

1 Like 1 ·
lancewu avatar image lancewu Jacob Gillespie ♦ commented ·

Thank you for your reply , Jacob!

It worked! I can use cmd to open flexsim software and run flexsimscript in txt format. The content of cmd is as follows:

"C:\Program Files\Flexsim 2022 Update 1\program\flexsim.exe" "C:\Users\SHENNAN.WU\Desktop\test.fsm" /maintenance disablemsg_runscript /scriptpath "C:\Users\SHENNAN.WU\Desktop\test.text"


But my system development software chooses visual studio and C++language. Can I implement the function of the content in the cmd above in visual studio?

thank u !

0 Likes 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦♦ lancewu commented ·
0 Likes 0 ·
lancewu avatar image lancewu commented ·

Hi Jason, thank you for your reply. But what I want to achieve is to not open the flexsim software and only perform some operations through visual studio. Obviously, the DLL method is not applicable. Is there any other method?

0 Likes 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦♦ lancewu commented ·

What is your application here? Perhaps if we know more we can better guide you.

Trying to use FlexSim without opening it could violate the terms of the license (?).

1 Like 1 ·
lancewu avatar image lancewu Jason Lightfoot ♦♦ commented ·

I want to create a platform where I input the processor and CT, and flexsim will automatically create the processor and set CT, then start running and output the chart. I can now use Flexsim scripts to automatically create processors, but I cannot link Visual Studio with Flexsim. Because my platform is aimed at people who do not know how to use flexsim, I think it can be implemented without opening flexsim.

0 Likes 0 ·
Show more comments