• Login
sketchucation logo sketchucation
  • Login
ℹ️ GoFundMe | Our friend Gus Robatto needs some help in a challenging time Learn More

Default Open Folder

Scheduled Pinned Locked Moved Plugins
9 Posts 4 Posters 1.5k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    ken
    last edited by 15 Apr 2012, 11:58

    After closing Sketchup and then re-opening, Sketchup defaults to the folder that is indicated in the System Preference, files. Would it be possible to make a button, that after saving, you click on the button, and Sketchup will save the last folder used as the System Preference, files. So when I open Sketchup the next time, and go to file open, it will now default to the new location?

    Thanks in advance

    Ken

    Fight like your the third monkey on Noah's Ark gangway.

    1 Reply Last reply Reply Quote 0
    • T Offline
      TIG Moderator
      last edited by 15 Apr 2012, 13:43

      HKEY_CURRENT_USER\Software\Google\SketchUp8\File Locations\Models
      is the file path to the default 'Models' folder set in 'Preferences > Files'; it is written to the Registry.
      There's no API way of reading or writing this key/value - the space in the path, and/or its data-type seems to cause issues.
      You can't leave it blank either - it defaults to the user's Documents folder, even if you make the Registry entry "" by manual editing.
      You could try to write a Ruby [run from a button] that would make a short 'cmd' file [which the Ruby then would run from a temp folder, which then deletes itself on completion] it would rewrite that Registry entry with the current File.dirname(model.path) ? The problem then is that as Sketchup closes it rewrites the Registry value from its memory and so the change is never used. The only way to effect is when Sketchup is closed, which rather defeats the object...
      So as far as I can see you can't change this value within Sketchup itself via the API, only manually from the Preferences options...

      TIG

      1 Reply Last reply Reply Quote 0
      • K Offline
        ken
        last edited by 15 Apr 2012, 14:09

        TIG

        Thanks for the reply. Just wondering is there a way to write a Ruby that would save the last folder accessed, and when you opened Sketchup again, you click on this button and it opened up that folder, allowing you to access the files to open at this location.

        I guess there would be two buttons, one to save the location, and one to access the locations.

        Just a thought. Way beyond my skills.

        However, thank you again for the reply.

        Ken

        Fight like your the third monkey on Noah's Ark gangway.

        1 Reply Last reply Reply Quote 0
        • R Online
          Rich O Brien Moderator
          last edited by 15 Apr 2012, 14:16

          not quite but....

          http://forums.sketchucation.com/viewtopic.php?t=35803

          Download the free D'oh Book for SketchUp

          1 Reply Last reply Reply Quote 0
          • K Offline
            ken
            last edited by 15 Apr 2012, 14:55

            Rich

            Thanks for the info. The plugin you suggested almost does the trick. However, it brings the Sketchup file in as an insert, so I lose the file name. Going to dig to see if I can change how the file is opened.

            Close but no cigar.

            Thanks Rich for your reply. It is amazing how many plugins there are out there and hidden from view.

            Ken

            Fight like your the third monkey on Noah's Ark gangway.

            1 Reply Last reply Reply Quote 0
            • D Offline
              Dan Rathbun
              last edited by 25 Apr 2012, 22:22

              I tested this on Windows 7, and it appears to work the same as on XP.
              (When the SketchUp path is set to a non-existent folder, the Windows MRU paths take over.)

              I'm not here much anymore.

              1 Reply Last reply Reply Quote 0
              • T Offline
                TIG Moderator
                last edited by 26 Apr 2012, 09:09

                It's a clever trick. πŸ˜„
                Manually setting it to "" [by editing the registry with regedit] doesn't work as Sketchup then assumes the user's Documents folder!
                You could set it to a non-existence folder that way and the existing part of the path will become the default ?
                Rather than the mess of making a folder, linking to it and then deleting the folder etc, you could run a fixdir.cmd file to add a non-existent folder path?

                REG ADD "HKCU\Software\Google\SketchUp8\File Locations" /v "Models" /d "C;\[.]" /f
                pause
                
                

                Of course you mustn't have a folder named " [.]" in that location!
                It will then set " C:" as the default location when the folder is not found, but it will use the last used folder during that session otherwise.
                So if you'd prefer your desktop as the default folder try "C:\Users\YourID\Desktop\[.]" etc...

                TIG

                1 Reply Last reply Reply Quote 0
                • D Offline
                  Dan Rathbun
                  last edited by 23 Mar 2019, 21:16

                  ❗
                  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.
                  ❗

                  I'm not here much anymore.

                  1 Reply Last reply Reply Quote 0
                  • D Offline
                    Dan Rathbun
                    last edited by 23 Mar 2019, 21:17

                    ❗
                    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.
                    ❗

                    Hold up a min! I Found a workaround to force SketchUp to use Windows MRU paths...

                    ...[ drumroll ]...

                    1) Open a File Explorer and create a "dummy" folder "C:/dummy"

                    2) Open SketchUp.. goto "Preferences" > "Files" panel.

                    Click the browse Folder button and choose this empty folder.
                    Your Models path should say: "**C:\dummy**"

                    3) Close SketchUp.

                    4) Delete the "C:\dummy" folder.

                    5) Restart SketchUp. It will now use MS Windows saved MRU paths for "*.skp" filetype.

                    .. No custom button or menuitem needed.

                    πŸ˜„

                    ❗
                    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.
                    ❗

                    I'm not here much anymore.

                    1 Reply Last reply Reply Quote 0
                    • 1 / 1
                    • First post
                      Last post
                    Buy SketchPlus
                    Buy SUbD
                    Buy WrapR
                    Buy eBook
                    Buy Modelur
                    Buy Vertex Tools
                    Buy SketchCuisine
                    Buy FormFonts

                    Advertisement