question

Sean Webster avatar image
0 Likes"
Sean Webster asked Jason Lightfoot commented

Any way to speed up script loading?

I wrote a program which uses data from an AutoCAD drawing of a conveyor system and generates an equivalent FlexSim model. It creates a script which I have been pasting into flexsim. As I've tested it on larger systems, the FlexSim script editor has become a bit of a problem due to how long it takes to load. On my computer, an ~15,000 line script takes around 10 mins to paste into the editor and during this time, FlexSim is unresponsive and gives no indication of progress on loading the script. Once the script is actually loaded, it runs great and only takes a few seconds to execute. When pasting the same script into a code editor like Visual Studio, it loads in around 1 second.

Is there anyway that I can turn off the text processing in the script editor and just get it to execute the script without the text editor processing? Or is there a way to load the script from a text document directly and execute it that way?

FlexSim 21.1.2
flexsim 21.1.2script
· 3
5 |100000

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

1 Answer

Ben Wilson avatar image
3 Likes"
Ben Wilson answered Jason Lightfoot commented

Hi @Sean Webster,

Try the executefsfile() command:

executefsfile (str filename, num direct)

Description

For developer use. Executes Flexscript code in a file. The specified file is loaded and its content is executed. The contents of the file are assumed to be valid Flexscript code. If direct is 0, then FlexSim's program directory will be concatenated onto the front of filename, otherwise filename will remain as it is.

Example

executefsfile("c:/myscript.fs",1)


· 2
5 |100000

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