Can we use Revit python wraper select multiple files

Hi, our genius.
I manage to use RPW select multiple files and already setting multiple is True, but the script output aways is only one file. (when I select files in the windows form it can select multiple, but output only one)
I m not sure its my mistake or is RPW issue.
Here have some snapshots for a detail description.
image



Hi,

Can you try:
filepath = ui.forms.select_file(‘Revit Model(*.rvt)’, ‘Select RVT File’, multiple=True)

It’s same with before.:joy:

path = IN[0]
import sys
sys.path.append(path)
import rpw
from rpw import *

filepath = ui.forms.select_file('Revit Model(*.rvt)|*rvt', 'Select RVT File', multiple=True)

OUT = filepath

Hi please see this new topic and there has a solution.

Have you tried it without | *rvt as @blsalvio suggested?
edit :
sorry, it doesn’t make sense to leave it out. The function needs the extension filter to be described that way.
edit2:
It seems like the Dynamo package of rpw is missing a part in the definition of select_folder. It does not take multiple when returning the filenames.

Paste the following into your python editor in Dynamo:

import sys
sys.path.append(IN[0])

from rpw.ui.forms.resources import *	
def select_file(extensions='All Files (*.*)|*.*',
                title="Select File",
                multiple=False,
                restore_directory=True):
    form = Forms.OpenFileDialog()
    form.Filter = extensions
    form.Title = title
    form.Multiselect = multiple
    form.RestoreDirectory = restore_directory
    if form.ShowDialog() == Forms.DialogResult.OK:
        return form.FileName if not multiple else list(form.FileNames)

filepath = select_file('Revit Model(*.rvt)|*rvt', 'Select RVT File', multiple=True)

OUT = filepath

The Dynamo package is missing the if not multiple else list(form.FileNames) part

Hi,Kibar:grinning:
Thanks for your study, and learn from you.before I didn’t check the RPW package node. now your code is working very well.