question

Alessio Merlo avatar image
0 Likes"
Alessio Merlo asked Jordan Johnson answered

multi selection with filebrowse command

Hi,

I need to open a standard windows file browser dialog window, select more than one csv file and import them into FlexSim. Does anyone know if it is possible? Or can you suggest a workaround?

FlexSim 18.0.4
filebrowsemulti selection
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

Jordan Johnson avatar image
4 Likes"
Jordan Johnson answered

You can use getfilebrowse:

treenode fileList = model().find("Tools").subnodes.assert("FilesToImport");

Variant files = getfilebrowse("*.csv", "CSV Files", "", modeldir(), 2, fileList);
if (files.length == 0)
	return 0;

// Process the files in fileList
return files;

The second-to-last argument, 2, specifies that multiple selection is possible. It puts each individual file as a subnode in the specified node. Once you have the list, you can use importtable() to read the data.

5 |100000

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