Cancelling File Selection Window Crashes Rhino 7 & 6

@dale,

I have a script to import pointclouds. To select the files to import I use code like this:

from rhinoscriptsyntax import OpenFileNames
filtr = 'Text Files (*.txt)|*.txt| XYZ Color files (*.xyz)|*.xyz|pts Files (.pts)|*.pts||'
strPaths = OpenFileNames('XYZRGB file to import', filtr)

Download from here:
XYZRGB_Import_File_Names_Crashes_Rhino.py (195 Bytes)

If you run this short script, a file selection window will pop up. If you cancel this window, then Rhino crashes after a few seconds.

Is this a bug or should I be doing this another way? The crash does not occur when selecting only a single file and cancelling the file selection window using this code:

from rhinoscriptsyntax import OpenFileName
filtr = 'Text Files (*.txt)|*.txt| XYZ Color files (*.xyz)|*.xyz|pts Files (.pts)|*.pts||'
strPath = OpenFileName('XYZRGB file to import', filtr)

The crash happens in both Rhino 7 and 6.

Regards,
Terry.

@dale, @brian, @stevebaer,

Enclosing the strPaths line with try/except does not help; Rhino still crashes using the code below:

from rhinoscriptsyntax import OpenFileNames
filtr = 'Text Files (*.txt)|*.txt| XYZ Color files (*.xyz)|*.xyz|pts Files (.pts)|*.pts||'
try: strPaths = OpenFileNames('XYZRGB file to import', filtr)
except: pass

Regards,
Terry.

Hi @Terry_Chappell ,

Thanks, I’ve reported the issue.

https://mcneel.myjetbrains.com/youtrack/issue/RH-62568

– Dale

1 Like

@dale,

Thanks for your help with this issue. I stumbled across its existence when debugging my Python/C++ script. I would compile the C++ in Debug mode and then, on the Python side, I would launch the script without remembering to select the Debug DLL version at the top of the script. I would remember this just as the files selection menu would come up and try to cancel so I could go back to fix this without having to wait the 30 sec it takes for the script to import and display a 21GB pointcloud. But oops Rhino would crash and I would have to start all over.

Regards,
Terry.