How to use visual studio link flexsim

How to use visual studio link flexsim

lancewu
Not applicable
58 Views
11 Replies
Message 1 of 12

How to use visual studio link flexsim

lancewu
Not applicable

[ FlexSim 22.1.4 ]

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

0 Likes
Accepted solutions (1)
59 Views
11 Replies
Replies (11)
Message 2 of 12

jason_lightfootVL7B4
Autodesk
Autodesk

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

0 Likes
Message 3 of 12

jason_lightfootVL7B4
Autodesk
Autodesk
Accepted solution

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

0 Likes
Message 4 of 12

lancewu
Not applicable

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
Message 5 of 12

jason_lightfootVL7B4
Autodesk
Autodesk

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 (?).

Message 6 of 12

lancewu
Not applicable

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
Message 7 of 12

jason_lightfootVL7B4
Autodesk
Autodesk
You can create a dashboard gui and custom environment in FlexSim for this.

Or you can create a model that when opened reads a text file to create objects and run the experiment. You could also issue a job to FlexSim's webserver to start FlexSim, load that model, read the file, run the job and return the output via JSON.


There are many possibilities.

0 Likes
Message 8 of 12

Jacob_Gillespie
Autodesk
Autodesk

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

Message 9 of 12

lancewu
Not applicable

thank you jason!

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 your time !

0 Likes
Message 10 of 12

lancewu
Not applicable

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
Message 11 of 12

jason_lightfootVL7B4
Autodesk
Autodesk
0 Likes
Message 12 of 12

jason_lightfootVL7B4
Autodesk
Autodesk
0 Likes