This was written in 2012 for SketchUp v8 when Windows 7 was current. Please do not PM me in 2019 and tell me it does not work for current SketchUp versions. Things change as OSes and applications are revised.
The trick is to let MS Windows MRU filetypes handle what folder will be opened to select a file (of the extension asked for.)
So you'll have to make your own toolbar button (or assign a hotkey to,) the following command:
Sketchup.open_file UI.openpanel('*.skp')
Windows itself will search it's own MRU list that it maintains (no matter what application is or was in use,) when that filetype was last saved. (MRU is an acronym for Most Recently Used.) If Windows has not yet logged a particular filetype, it's likely it will open either in "My Documents" or in the "Desktop" folder. Once a non-cancelled save has occured, an attribute with a path value, will be written into Windows MRU key.
Subsequent calls using the MS Common Filesave and Fileopen dialogs, (which UI.openpanel
and UI.savepanel
uses,) with just the filetype, will use the paths stored in the MRU key attributes.
This was written in 2012 for SketchUp v8 when Windows 7 was current. Please do not PM me in 2019 and tell me it does not work for current SketchUp versions. Things change as OSes and applications are revised.