sketchucation logo sketchucation
    • 登入
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    🔌 Smart Spline | Fluid way to handle splines for furniture design and complex structures. Download

    [Plugin] SketchUcation Tools 2.6.1

    已排程 已置頂 已鎖定 已移動 Plugins
    127 貼文 32 Posters 94.1k 瀏覽 32 Watching
    正在載入更多貼文
    • 從舊到新
    • 從新到舊
    • 最多點贊
    回覆
    • 在新貼文中回覆
    登入後回覆
    此主題已被刪除。只有擁有主題管理權限的使用者可以查看。
    • TIGT 離線
      TIG Moderator
      最後由 編輯

      Thanks.

      Looks like there is nothing odd about your $: 😕

      Looks like a permissions issue to me...
      Find C:\Users\CAETANO\AppData\Roaming\SketchUp\SketchUp 2015\SketchUp
      then with Admin powers, step up one level and select its folder-icon,
      ensure it has FULL permissions set for ALL those listed under:
      Right-click > Context-menu > Properties > Security > Edit OK/Apply
      Repeat the ' FULL' set up for the folders contents - there should be three subfolders Plugins, Classifications, Tools.
      Ensure that the contents of the ' Plugins' folder are all also set ' FULL'.
      The permission changes should automatically apply to a folder's contents, but just double-check...
      If the ' Plugins' folder is missing try making it ??
      try to delete the folder's "cookiejar.xml" file too - it might be corrupted.

      Restart SketchUp and test...

      If this fails...
      I see you have a Vray installation.
      Can you disable that plugin, restart SketchUp and retry - to see if it is somehow conflicting ?

      TIG

      1 條回覆 最後回覆 回覆 引用 0
      • thomthomT 離線
        thomthom
        最後由 編輯

        @caecarvalho said:

        Error: #<RuntimeError: can't modify frozen String>
        c:/users/caetano/appdata/roaming/sketchup/sketchup 2015/sketchup/plugins/sketchucation/scf_dialog.rbs:517:in `gsub!'

        TIG - what is the source of the string you call gsub! on?

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

        1 條回覆 最後回覆 回覆 引用 0
        • TIGT 離線
          TIG Moderator
          最後由 編輯

          def self.chooseplugins(p=nil)
            p = nil if p == ''
            if p
              p.gsub!(/["]/, "'") ### line 517
              @choi = p
            else
              @choi=nil
            end
            RBZtool.set_choi(@choi, @url, @cloud)
          end
          

          Is the method
          chooseplugins receives the chosen plugins folder's path-name.
          The chosen path is from a list assembled from folder-paths in $: which is filtered to remove folders like Tools, Ruby folders etc...
          I think that gsub is unlikely ever to include a ", but since it's via a callback, js might mess up ?
          It only runs if 'p' is not nil.
          The 'p' passed should always be a 'string' [folder-path].
          I'm wondering if a non-standard Vray path containing a '' rather than a '/' is causing an issue...
          It'd be easily trappable in the $: filtering, but it's not at the moment...
          😕
          Disabling Vray from loading might show this up ?

          What does your dialog offering custom-plugins folder choices look like ??

          TIG

          1 條回覆 最後回覆 回覆 引用 0
          • D 離線
            driven
            最後由 編輯

            @tig said:

            ... path containing a '' rather than a '/' is causing an issue...

            I recently had a problem with 'mixed separator' paths [on a PC test], oddly File.join was returning it, but using either worked...

            or can you test for .frozen?

            john

            learn from the mistakes of others, you may not live long enough to make them all yourself...

            1 條回覆 最後回覆 回覆 引用 0
            • TIGT 離線
              TIG Moderator
              最後由 編輯

              Can you please substitute the two RBS files in the attached ZIP [you need to extract them and move them manually], with the same named files in the ../Plugins/SketchUcation subfolder...
              And restart SketchUp and retest.
              This version traps for '' in $: folder-paths and makes them all '/' - so rogue paths [like Vray's] in $: don't mess us up...
              If it works we know it's the culprit...
              If not == Plan-B 😕


              PutIntoSketchUcationSubfolder.zip

              TIG

              1 條回覆 最後回覆 回覆 引用 0
              • thomthomT 離線
                thomthom
                最後由 編輯

                That method appear to modify the input arguments. I wonder if you are passing around a reference from the system which might have been locked to protect it. The trivial way around that would be to not use the bang version of gsub ensuring that you create a copy when you modify the string.

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

                1 條回覆 最後回覆 回覆 引用 0
                • D 離線
                  driven
                  最後由 編輯

                  @tig said:

                  If not == Plan-B :?

                  isn't the primary error attempting to gsub the frozen string [probably VRay]

                  in which case would .dup.gsub be the safer route?

                  john

                  learn from the mistakes of others, you may not live long enough to make them all yourself...

                  1 條回覆 最後回覆 回覆 引用 0
                  • TIGT 離線
                    TIG Moderator
                    最後由 編輯

                    The attached files redo the method, hopefully avoiding the gsub completely.
                    The recode also replaces the '' with '/' in the folder-paths just in case.
                    I am unclear how a 'string' passed into the $: could be frozen when pushed into there ?
                    The gsub! manipulation occurred in a 'clone' of the $: anyway !
                    Let's see what the OP finds...

                    TIG

                    1 條回覆 最後回覆 回覆 引用 0
                    • thomthomT 離線
                      thomthom
                      最後由 編輯

                      @tig said:

                      I am unclear how a 'string' passed into the $: could be frozen when pushed into there ?

                      When adding objects to arrays you pass a reference - so the string could have been locked before pushed. That doesn't sound like something Ruby itself does, but it could be an extension that did it. For instance, it could create a constant to it's support folder - and then freeze it in order to protect its constant from inadvertent change. Then it could have pushed it to $; for convenience (all though that would be bad practice IMO).

                      In any case - when iterating or fetching values external to your own extension, be careful to use methods that modify the object. Make sure to copy it as Ruby as the objects you pass around will refer to the same memory. http://stackoverflow.com/a/10974116/486990

                      So if you iterate $: and use gsub you will be modifying the content of $: which might lead to unexpected result for the rest of the system.

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

                      1 條回覆 最後回覆 回覆 引用 0
                      • C 離線
                        caecarvalho
                        最後由 編輯

                        @unknownuser said:

                        Looks like there is nothing odd about your $: 😕

                        Looks like a permissions issue to me...
                        Find C:\Users\CAETANO\AppData\Roaming\SketchUp\SketchUp 2015\SketchUp
                        then with Admin powers, step up one level and select its folder-icon,
                        ensure it has FULL permissions set for ALL those listed under:
                        Right-click > Context-menu > Properties > Security > Edit
                        OK/Apply
                        Repeat the 'FULL' set up for the folders contents - there should be three subfolders Plugins, Classifications, Tools.
                        Ensure that the contents of the 'Plugins' folder are all also set 'FULL'.
                        The permission changes should automatically apply to a folder's contents, but just double-check...
                        If the 'Plugins' folder is missing try making it ??
                        try to delete the folder's "cookiejar.xml" file too - it might be corrupted.

                        Restart SketchUp and test...

                        If this fails...
                        I see you have a Vray installation.
                        Can you disable that plugin, restart SketchUp and retry - to see if it is somehow conflicting ?

                        Hi Guys,

                        I've seen a lot have been discussed, but I had the problem solved the hard way... 😞 Uninstalled everything, deleted all the remaining folders and reinstalled everything again...

                        I've tryied everything that TIG said above but still no success... So what I did was:

                        • Login as admin and ensured full permissions to every user to folder C:\Users\CAETANO\AppData\Roaming\SketchUp\SketchUp 2015\SketchUp and everything inside it.
                          -Deleted the "cookiejar.xml" file.
                          After that, ran SU and didn't work... So I disabled VFS and still didn't work...

                        So I got mad and unistalled everything!! 😠

                        But I'd like to thank you for your time to try to help!

                        All the best,

                        Caetano

                        1 條回覆 最後回覆 回覆 引用 0
                        • TIGT 離線
                          TIG Moderator
                          最後由 編輯

                          @thomthom said:

                          @tig said:

                          I am unclear how a 'string' passed into the $: could be frozen when pushed into there ?

                          When adding objects to arrays you pass a reference - so the string could have been locked before pushed. That doesn't sound like something Ruby itself does, but it could be an extension that did it. For instance, it could create a constant to it's support folder - and then freeze it in order to protect its constant from inadvertent change. Then it could have pushed it to $; for convenience (all though that would be bad practice IMO).

                          In any case - when iterating or fetching values external to your own extension, be careful to use methods that modify the object. Make sure to copy it as Ruby as the objects you pass around will refer to the same memory. http://stackoverflow.com/a/10974116/486990

                          So if you iterate $: and use gsub you will be modifying the content of $: which might lead to unexpected result for the rest of the system.
                          It works on a clone of $:, so can I assume that the locked string still passes through that !
                          I can trap anyway for a gsub, so it's not critical...
                          EDIT:
                          After a little more delving I discovered some other potential pitfalls in $: paths containing \ versus / and 'cloning' of frozen strings etc...
                          The replacement RBS files in the attached ZIP should now avoid these ??


                          PutIntoSketchUcationSubfolder.zip

                          TIG

                          1 條回覆 最後回覆 回覆 引用 0
                          • tt_suT 離線
                            tt_su
                            最後由 編輯

                            @tig said:

                            It works on a clone of $:, so can I assume that the locked string still passes through that !

                            How do you clone?

                            If you do call .clone then you clone the Array object itself - but it's a shallow clone. It doesn't clone all it's internal data.

                            <span class="syntaxdefault"><br />x&nbsp;</span><span class="syntaxkeyword">=&nbsp;[</span><span class="syntaxstring">"hello"</span><span class="syntaxkeyword">,&nbsp;</span><span class="syntaxstring">"world"</span><span class="syntaxkeyword">]<br />[</span><span class="syntaxstring">"hello"</span><span class="syntaxkeyword">,&nbsp;</span><span class="syntaxstring">"world"</span><span class="syntaxkeyword">]<br /><br /></span><span class="syntaxdefault">y&nbsp;</span><span class="syntaxkeyword">=&nbsp;</span><span class="syntaxdefault">x</span><span class="syntaxkeyword">.clone<br />[</span><span class="syntaxstring">"hello"</span><span class="syntaxkeyword">,&nbsp;</span><span class="syntaxstring">"world"</span><span class="syntaxkeyword">]<br /><br /></span><span class="syntaxdefault">x</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">object_id<br />88135980<br /><br />y</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">object_id<br />90415700<br /><br />x</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">each&nbsp;</span><span class="syntaxkeyword">{&nbsp;|</span><span class="syntaxdefault">n</span><span class="syntaxkeyword">|&nbsp;</span><span class="syntaxdefault">puts&nbsp;n</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">object_id&nbsp;</span><span class="syntaxkeyword">}<br /></span><span class="syntaxdefault">88136040<br />88136000<br /></span><span class="syntaxkeyword">[</span><span class="syntaxstring">"hello"</span><span class="syntaxkeyword">,&nbsp;</span><span class="syntaxstring">"world"</span><span class="syntaxkeyword">]<br /><br /></span><span class="syntaxdefault">y</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">each&nbsp;</span><span class="syntaxkeyword">{&nbsp;|</span><span class="syntaxdefault">n</span><span class="syntaxkeyword">|&nbsp;</span><span class="syntaxdefault">puts&nbsp;n</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">object_id&nbsp;</span><span class="syntaxkeyword">}<br /></span><span class="syntaxdefault">88136040<br />88136000<br /></span><span class="syntaxkeyword">[</span><span class="syntaxstring">"hello"</span><span class="syntaxkeyword">,&nbsp;</span><span class="syntaxstring">"world"</span><span class="syntaxkeyword">]<br />&nbsp;</span><span class="syntaxdefault"></span>
                            
                            1 條回覆 最後回覆 回覆 引用 0
                            • tt_suT 離線
                              tt_su
                              最後由 編輯

                              This article expand on the whole pass-reference-by-value nature of Ruby:
                              http://robertheaton.com/2014/07/22/is-ruby-pass-by-reference-or-pass-by-value/

                              1 條回覆 最後回覆 回覆 引用 0
                              • TIGT 離線
                                TIG Moderator
                                最後由 編輯

                                Is this array.clone versus array.dup ?
                                I have side-stepped that process now anyway, by making a new array and adding items to that...

                                TIG

                                1 條回覆 最後回覆 回覆 引用 0
                                • tt_suT 離線
                                  tt_su
                                  最後由 編輯

                                  @tig said:

                                  Is this array.clone versus array.dup ?
                                  I have side-stepped that process now anyway, by making a new array and adding items to that...

                                  Are you cloning the items you add?

                                  1 條回覆 最後回覆 回覆 引用 0
                                  • TIGT 離線
                                    TIG Moderator
                                    最後由 編輯

                                    In the format item = (""+d.to_s) where ' d' is the element taken from the array...

                                    TIG

                                    1 條回覆 最後回覆 回覆 引用 0
                                    • Dan RathbunD 離線
                                      Dan Rathbun
                                      最後由 編輯

                                      Reminder that obj#clone() copies the frozen state of obj, whilst obj#dup() does not.

                                      I'm not here much anymore.

                                      1 條回覆 最後回覆 回覆 引用 0
                                      • Dan RathbunD 離線
                                        Dan Rathbun
                                        最後由 編輯

                                        Back on topic, the person's problems came from the fact that they changed the plugin folder's icon under Windows, which messes up permissions. I've never been able to (comfortably) fix the folder except by re-creating it, copying all it's contents over, and deleting the one the had the changed icon. (...yes even despite the "Repair" button,...)

                                        I'm not here much anymore.

                                        1 條回覆 最後回覆 回覆 引用 0
                                        • W 離線
                                          wahoowetzel
                                          最後由 編輯

                                          Hi All,

                                          dumb question maybe, how do I use the plugin store extension with a different profile/how do I change my profile? I want to log into a different account.

                                          1 條回覆 最後回覆 回覆 引用 0
                                          • Rich O BrienR 線上
                                            Rich O Brien Moderator
                                            最後由 編輯

                                            You can't use multiple accounts on a device.

                                            Download the free D'oh Book for SketchUp 📖

                                            1 條回覆 最後回覆 回覆 引用 0
                                            • 1
                                            • 2
                                            • 3
                                            • 4
                                            • 5
                                            • 6
                                            • 7
                                            • 7 / 7
                                            • 第一個貼文
                                              最後的貼文
                                            Buy SketchPlus
                                            Buy SUbD
                                            Buy WrapR
                                            Buy eBook
                                            Buy Modelur
                                            Buy Vertex Tools
                                            Buy SketchCuisine
                                            Buy FormFonts

                                            Advertisement