When I use “Import” command from a script with some .stl files it takes too much, 5 or 6 minutes.
This is the code line I use:
Rhino.Command("-_Import " & filepath & " _Enter")
For example, one .stl file of 1,7 MB takes more than 5 minutes and another of 1,4 MB takes 1 second. Both of them are binary .stl files.
Any idea of what is happening here? Is there any other way to open a file with no user interaction (OpenFileName is not an option because it opens a window to select the file)?
@pascal: Every file is located in the same local directory. I have used the 1,4 MB and 1,7 MB files as an example, but I get the same problem with several files, smaller and bigger.
@menno: I have tried your solution and I get the same behaviour. The thing is that the file opens at the end, so it is not a problem related to the command doesn’t finish OK. The issue is the time it takes.
Is there another way to open a file instead of Rhino.Command "_-Import" ?
It could be the topology of the files causes the importer to need more time processing it.
I’m on my phone so the description below is by approximation.
If you run te regular import command, STL files have an option to be welded and split into disjoint parts. If you set both options to not be executed you can check if either of these cause the difference.