Quantcast
Channel: Scripting - McNeel Forum
Viewing all articles
Browse latest Browse all 5892

Browse for File and Insert

$
0
0

@eric.bunn wrote:

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)

Posts: 3

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 5892

Trending Articles