FileOpenDialog Open Multiple Files

FileOpenDialog Open Multiple Files

Anonymous
Not applicable
2,946 Views
2 Replies
Message 1 of 3

FileOpenDialog Open Multiple Files

Anonymous
Not applicable

I am interested in allowing the user to select multiple files as input and getting the file paths of the select files. For example, if I have a folder with 3 different .rvt files, I would like the user to be able to control select two of those and getting the file path of both of those files.

 

Is this possible?

 

Currently, I am using the FileOpenDialog() Class which only allows for one file at a time. Is there an alternative that will allow for multiple file selection?

 

Thank you!

0 Likes
Accepted solutions (1)
2,947 Views
2 Replies
Replies (2)
Message 2 of 3

jeremytammik
Autodesk
Autodesk
Accepted solution

Search the Internet before asking a question, please.

 

 E.g., search for 'FileOpenDialog multiple':

 

https://duckduckgo.com/?q=FileOpenDialog+multiple&ia=qa

 

The first entry I see leads to:

 

https://stackoverflow.com/questions/1311578/opening-multiple-files-openfiledialog-c


Opening multiple files OpenFileDialog, C#

 

You must set the OpenFileDialog.Multiselect Property value to true, and then access the OpenFileDialog.FileNames property.

 

Cheers,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 3 of 3

Anonymous
Not applicable

Jeremy,

 

I was just searching for the wrong thing. I thought the Revit API FileOpenDialog() class had a multiselect, but I needed to use the System.Windows.Forms version OpenFileDialog()

 

Thank you!