Browse for File and Insert

I’m looking for code that will allow me to browse for a file and then use the insert command to insert it. I found the following code which works to insert a file but the path is hard coded in. I want to browse for the file, capture the filepath and then insert it.

Lastly, the script below works but one has to hit enter on the keyboard to get it to finish? Any way to just insert it without having to hit enter?

#Sample Code to Insert a File as a Block
strOpen = “C:\FPE Title Block_1 (11 x 17 Landscape) v5.3dm”
strOpen = strOpen.lower()

#Format Command for Import
strFile = “! _-Insert File=Yes " + chr(34) + strOpen + chr(34) + " _Block 0 1 0 _Enter”
print(strFile)

Use rhinoscriptsyntax.OpenFileName.

Use rhinoscriptsyntax.Command.

– Dale

That worked. Thanks.

Eric