• Login
sketchucation logo sketchucation
  • Login
πŸ€‘ SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

Where to Store User Settings?

Scheduled Pinned Locked Moved Developers' Forum
29 Posts 7 Posters 1.7k Views 7 Watching
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.
  • J Offline
    Jim
    last edited by 24 Nov 2011, 10:42

    Here's an article with some more specific info for working with several recent versions of Windows.

    What’s the Recommended Location for Application Files?

    The article only confirms what has already been said here: %APPDATA% is the correct folder (or better to use your own sub-folder under %APPDATA%.)

    Hi

    1 Reply Last reply Reply Quote 0
    • T Offline
      thomthom
      last edited by 24 Nov 2011, 10:56

      But roaming or local?

      Thomas Thomassen β€” SketchUp Monkey & Coding addict
      List of my plugins and link to the CookieWare fund

      1 Reply Last reply Reply Quote 0
      • J Offline
        Jim
        last edited by 24 Nov 2011, 10:59

        Why not always roaming? Is there a specific case for local?

        I might use local if the file(s) were for a license key tied to a specific machine. But otherwise, I can't think of a reason not to use roaming.

        Hi

        1 Reply Last reply Reply Quote 0
        • T Offline
          thomthom
          last edited by 24 Nov 2011, 11:13

          Yea - I wasn't sure if roaming could be used if the user where not on a domain. (I don't have any experience with that kind of stuff...)

          Thomas Thomassen β€” SketchUp Monkey & Coding addict
          List of my plugins and link to the CookieWare fund

          1 Reply Last reply Reply Quote 0
          • T Offline
            TIG Moderator
            last edited by 24 Nov 2011, 11:27

            ENV["APPDATA"] returns the PC User's 'Roaming' folder anyway... πŸ˜•

            TIG

            1 Reply Last reply Reply Quote 0
            • K Offline
              kirill2008
              last edited by 25 Nov 2011, 11:41

              I think it is possible to store user settings right in *.skp file. Why not? AutoCAD stores a lot of settings (a plenty of settings) in *.dwg file for example.
              I'm not sure about problems with such approach, but it works well for some of user settings. I use "Sketchup.active_model.set_attribute" to store user settings.
              Ok, it's not ideal solution of course: it increases file size, I guess. And it does not fit for user settings, that have to be insensitive for *.skp file. And a lot of excess data will be attached to each *.skp file instead of single *.ini file.

              1 Reply Last reply Reply Quote 0
              • T Offline
                thomthom
                last edited by 25 Nov 2011, 11:54

                @kirill2008 said:

                I think it is possible to store user settings right in *.skp file. Why not? AutoCAD stores a lot of settings (a plenty of settings) in *.dwg file for example.
                I'm not sure about problems with such approach, but it works well for some of user settings. I use "Sketchup.active_model.set_attribute" to store user settings.
                Ok, it's not ideal solution of course: it increases file size, I guess. And it does not fit for user settings, that have to be insensitive for *.skp file. And a lot of excess data will be attached to each *.skp file instead of single *.ini file.

                That would then not be User data - but Model data. Two very different things.

                Thomas Thomassen β€” SketchUp Monkey & Coding addict
                List of my plugins and link to the CookieWare fund

                1 Reply Last reply Reply Quote 0
                • T Offline
                  TIG Moderator
                  last edited by 25 Nov 2011, 12:02

                  User data specific to Sketchup can be stored with Sketchup itself in the Registry [Plist on Mac] ?
                  Sketchup.write_default(section,variable{,optional_default}) Sketchup.read_default(section,variable,value)
                  You obviously need to 'compile' the value[s] to write and read back in specific ways.
                  If there are 'many things' to keep across sessions then a saving them into a Users/Name/AppData/Roaming/ Sketchup subfolder, inside a tool specific subfolder or ini file etc would also be possible - not sure about Mac alternative...

                  TIG

                  1 Reply Last reply Reply Quote 0
                  • K Offline
                    kirill2008
                    last edited by 25 Nov 2011, 17:55

                    @thomthom said:

                    That would then not be User data - but Model data. Two very different things.

                    Looks like I interpreted thread subject in a context of my own thoughts 😳
                    I mean, I was going to suggest to use template for storing user settings data.
                    template.png
                    It is less elegant than just click "OK" button in "Settings" dialog of the plugin, of course πŸ˜„ But the user can save his own presets in template file, add description to it, then it will be possible to revert back to any previously saved configuration.

                    UPD.
                    The point is that I was thinking about abstract "application user" not the operating system user. Application means plugin here.
                    So I thought that application (plugin) usually runs "system wide" (not in "per user mode") and the problem is what is the best way to persist application settings (i.e. user preferences *application user here again).
                    Storing plugin settings right in document allows user preferences persistence across different machines and even across operating systems in theory πŸ˜‰ (when I say "user" I mean plugin user). So user can take his *.skp file anywhere and continue working with it on any device that has SU and plugin πŸ˜„ and he does not have to care about configuring plugin again on each device.

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

                    Advertisement