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?
Answer by Ben Wilson ·
Hi @Sean Webster,
Try the executefsfile() command:
executefsfile (str filename, num direct)
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.