How to set the import options (which will comes up after import stl file use rhino script) automatically use rhino script

Anybody can help on this? thank you!

when use rhino script to import stl file, the scripts shows below:

Sub TestFileOpen()

' Local variable declarations
Dim strFile

' Let the user pick a 3dm file. If the return value is null,
' then the user picked the "Cancel" button...
strFile = Rhino.OpenFileName("Open", "Rhino stl Models (*.stl)|*.stl|")
If IsNull(strFile) Then Exit Sub

' To keep Rhino from displaying the dreaded
' "Save changes to <filename>" dialog, we can fool it
' into thinking that the document was never modified
' by doing the following.
Call Rhino.DocumentModified(False)

' If the picked a file that has a space character in its name,
' or resides in a folder that has a space character, then we
' need to surround the file string in double-quotes so Rhino's
' command line parser will interpret the string correctly.
strFile = Chr(34) & strFile & Chr(34)

' Now we can simply script Rhino's Open command to open the file.
Call Rhino.Command("_-Open " & strFile, 1)

End Sub

after run this script and select the target file, there will a selection options comes out to set the import options like the unit and some other items, after do the selection manually and “enter”, then come out our stl file view in the window.

my question is: how to do the selection of import options which comes out after do the selection of target file using rhino script but not manually, we want there is only one manually operation of select target file then every thing is automatically take care by rhino script.

thank you very much!

Hi @fengyee_zju,

see the script below how to set the export options and end the command prompt using _Enter.

TestFileOpen.rvb (455 Bytes)


thank you very much!