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] Estimates (extended)

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

      Edit the tool's attributes.rb file with Notepad or a similar plain-text editor.
      Find the line:
      currencies={"Euro"=>"€","Dollar"=>"$","SEK"=>"SEK"}
      Add [or delete]...
      To add 'Baht' insert a new lash member at the end thus:
      currencies={"Euro"=>"€","Dollar"=>"$","SEK"=>"SEK"**,"Baht"=>"฿"**}
      Or perhaps ... **=>"B"** depending on your PC's Unicode settings ?
      Also change the line:
      curList=["Euro","Dollar","SEK"].join("|")
      to include it...
      curList=["Euro","Dollar","SEK"**,"Baht"**].join("|")

      To make that currency your default, find the line:
      $estimates_currency="Euro" if !$estimates_currency
      change it to...
      $estimates_currency=**"Baht"** if !$estimates_currency

      Hope this helps...

      TIG

      1 條回覆 最後回覆 回覆 引用 0
      • T 離線
        thaigringo
        最後由 編輯

        Thanks for the quick reply...
        Made the changes but still Defaults to SEK...
        Any other suggestions?

        Fred

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

          I hope that you are editing the correct 'attributes.rb' file in the 'Examples' subfolder within the 'Plugins' folder... AND restarting Sketchup so the change is activated ?
          Are you sure you added "Baht" in the 3 places just as I said ?

          There is an alternative way...
          If you are always going to use "Baht" then you could set every thing to always use that.
          Change the dialog part as follows to avoid asking about 'Currency':
          prompts = [$exStrings.GetString("Unit: "), $exStrings.GetString("Default Material cost: ")] values = [units.index($estimates_unit), $estimates_cost_default_material]
          and also the line
          dropdowns=[curList,unList]
          must become
          dropdowns=[unList,""]
          and also the line after the dialog...
          Then the line
          $estimates_currency=currencies[results[0]]
          must become
          $estimates_currency="Baht"
          or
          $estimates_currency="฿"
          to use a 'symbol'...
          The other results must also be adjusted from
          $estimates_unit=units[results[1]] $estimates_cost_default_material=results[2]
          to
          $estimates_unit=units[results[0]] $estimates_cost_default_material=results[1]
          ...

          TIG

          1 條回覆 最後回覆 回覆 引用 0
          • T 離線
            thaigringo
            最後由 編輯

            Thanks again... I have made the changes to the correct attributes file and saved it and restarted SU but it didn't change the default currency... There are two $estimates_currency="Euro" if !$estimates_currency entries one is Line 19 and again at line 374... but the one at line 374 says "SEK"...
            If I change the entry at line 374, when I go to settings it shows nothing selected in the currency dropdown... The currency list is there but the default is blank...

            I will try the new suggestion tomorrow... I'm old and need my sleep... 2"30 am here.. Will let you know what happens...

            Thanks again

            Fred

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

              Sorry I missed the second entry !
              The script is a little muddled in its logic.

              As well as editing the ='Euro' line, edit the later line
              def estimate_defaults() $estimates_currency="SEK" if !$estimates_currency
              to read...
              def estimate_defaults() $estimates_currency="Baht"
              Or if you were using a 'symbol' use that instead of 'Baht'...
              This will always use "Baht" as your currency !

              TIG

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

                😞
                %(#BF0000)["Error Loading File attributes.rb
                undefined method `GetString' for nil:NilClass"
                ]

                can anyone help me please?

                1 條回覆 最後回覆 回覆 引用 0
                • Dave RD 離線
                  Dave R
                  最後由 編輯

                  Looks to me as if you haven't ticked the box for "Ruby Script Examples" in Window>Preferences>Extensions.

                  Etaoin Shrdlu

                  %

                  (THERE'S NO PLACE LIKE)

                  G28 X0.0 Y0.0 Z0.0

                  M30

                  %

                  1 條回覆 最後回覆 回覆 引用 0
                  • jemagnussenJ 離線
                    jemagnussen
                    最後由 編輯

                    Hi Dave,

                    I belive I have followed every instruction, but I must have overlooked something as I can't get it to work, get this error measage:

                    Error Loading File C:/Program Files (x86)/Google/Google SketchUp 8/Plugins/examples/exampleScripts.rb
                    undefined local variable or method ' for main:ObjectError Loading File examples.rb undefined local variable or method ' for main:Object

                    I have used "kr" as currency, edited the example.rb in notepad, changed as advised. Replaced the script file and restarted Sketchup several times.

                    Hope you can help.

                    Best regards
                    Jesper

                    HP ZBook 15, Windows 10 64 bit
                    Intel Core i7-6820HQ @ 2.70GHz
                    32 GB Ram
                    NVIDIA Quadro M2000M

                    1 條回覆 最後回覆 回覆 引用 0
                    • Dave RD 離線
                      Dave R
                      最後由 編輯

                      Did you tick the box for Ruby Script Examples under Extensions?

                      You changed your post while I was typing.

                      Do you have full administrative rights to the Plugins folder?

                      Etaoin Shrdlu

                      %

                      (THERE'S NO PLACE LIKE)

                      G28 X0.0 Y0.0 Z0.0

                      M30

                      %

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

                        The error-message suggests that you have mis-edited the code...
                        Get a fresh copy and with it opened in Notepad do a case-sensitive find/replace for SEK and substitute Kr - in every case - that's all that's needed...
                        If it still fail;s then can you post the line/s you edited [and the lines either side of it/them] - exactly as they appear [copy+paste] - use a 'code' formating tag...
                        Alternatively PM the whole file to me - don't post it all - it's confusing for members when faulty scripts are hanging around...

                        TIG

                        1 條回覆 最後回覆 回覆 引用 0
                        • jemagnussenJ 離線
                          jemagnussen
                          最後由 編輯

                          @dave r said:

                          Did you tick the box for Ruby Script Examples under Extensions?

                          You changed your post while I was typing.

                          Do you have full administrative rights to the Plugins folder?

                          Hi Dave,

                          Yes, I did tick on the Ruby script Excamples ans yes, I have admin right to the folder and file.

                          Best regards
                          Jesper

                          HP ZBook 15, Windows 10 64 bit
                          Intel Core i7-6820HQ @ 2.70GHz
                          32 GB Ram
                          NVIDIA Quadro M2000M

                          1 條回覆 最後回覆 回覆 引用 0
                          • Dave RD 離線
                            Dave R
                            最後由 編輯

                            I think TIG has identified the problem. 😉

                            Etaoin Shrdlu

                            %

                            (THERE'S NO PLACE LIKE)

                            G28 X0.0 Y0.0 Z0.0

                            M30

                            %

                            1 條回覆 最後回覆 回覆 引用 0
                            • jemagnussenJ 離線
                              jemagnussen
                              最後由 編輯

                              @tig said:

                              The error-message suggests that you have mis-edited the code...
                              Get a fresh copy and with it opened in Notepad do a case-sensitive find/replace for SEK and substitute Kr - in every case - that's all that's needed...
                              If it still fail;s then can you post the line/s you edited [and the lines either side of it/them] - exactly as they appear [copy+paste] - use a 'code' formating tag...
                              Alternatively PM the whole file to me - don't post it all - it's confusing for members when faulty scripts are hanging around...

                              Hi TIG,

                              Followed you advice to take a fresh copy, replace SEK with kr (case sensitive) but still get this error meassage when opening Sketchup 8 Pro after the change:

                              Error Loading File C:/Program Files (x86)/Google/Google SketchUp 8/Plugins/examples/exampleScripts.rb
                              undefined local variable or method ' for main:ObjectError Loading File examples.rb undefined local variable or method ' for main:Object

                              Brgds
                              Jesper

                              HP ZBook 15, Windows 10 64 bit
                              Intel Core i7-6820HQ @ 2.70GHz
                              32 GB Ram
                              NVIDIA Quadro M2000M

                              1 條回覆 最後回覆 回覆 引用 0
                              • jemagnussenJ 離線
                                jemagnussen
                                最後由 編輯

                                @jemagnussen said:

                                @tig said:

                                The error-message suggests that you have mis-edited the code...
                                Get a fresh copy and with it opened in Notepad do a case-sensitive find/replace for SEK and substitute Kr - in every case - that's all that's needed...
                                If it still fail;s then can you post the line/s you edited [and the lines either side of it/them] - exactly as they appear [copy+paste] - use a 'code' formating tag...
                                Alternatively PM the whole file to me - don't post it all - it's confusing for members when faulty scripts are hanging around...

                                Hi TIG,

                                Followed you advice to take a fresh copy, replace SEK with kr (case sensitive) but still get this error meassage when opening Sketchup 8 Pro after the change:

                                Error Loading File C:/Program Files (x86)/Google/Google SketchUp 8/Plugins/examples/exampleScripts.rb
                                undefined local variable or method ' for main:ObjectError Loading File examples.rb undefined local variable or method ' for main:Object

                                Brgds
                                Jesper

                                Just for clarity, it works fine without any changes.

                                HP ZBook 15, Windows 10 64 bit
                                Intel Core i7-6820HQ @ 2.70GHz
                                32 GB Ram
                                NVIDIA Quadro M2000M

                                1 條回覆 最後回覆 回覆 引用 0
                                • jemagnussenJ 離線
                                  jemagnussen
                                  最後由 編輯

                                  Hi all,

                                  it's actually kinda strange that when I take a fresh copy it works fine, I can use €, $ or SEK in settings and it works fine. When I do a Ctrl+H (replace) with case sensitive selected and replace all instances of SEK with kr then I get the error meassage and even when trying to reverse by asking for a change back from kr to SEK, I still get the error. Tried to change from SEK to NOK, same issue..?

                                  Best regards
                                  Jesper

                                  HP ZBook 15, Windows 10 64 bit
                                  Intel Core i7-6820HQ @ 2.70GHz
                                  32 GB Ram
                                  NVIDIA Quadro M2000M

                                  1 條回覆 最後回覆 回覆 引用 0
                                  • Dave RD 離線
                                    Dave R
                                    最後由 編輯

                                    Did you change every instance of SEK?

                                    Etaoin Shrdlu

                                    %

                                    (THERE'S NO PLACE LIKE)

                                    G28 X0.0 Y0.0 Z0.0

                                    M30

                                    %

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

                                      You has a very subtle problem indeed !

                                      A Ruby script is typically in "UTF-8 without BOM" text-encoding format.
                                      When you edited it with Notepad and saved it, its format changed to "UFT-8", which corrupts the text so it then fails to load properly...
                                      I will PM you a suitably encoded copy...
                                      Can I suggest you get "Notepad++" [free].
                                      It has special Ruby Syntax highlighting etc and you can set it to always open/save files with the right encoding...

                                      TIG

                                      1 條回覆 最後回覆 回覆 引用 0
                                      • jemagnussenJ 離線
                                        jemagnussen
                                        最後由 編輯

                                        @tig said:

                                        You has a very subtle problem indeed !

                                        A Ruby script is typically in "UTF-8 without BOM" text-encoding format.
                                        When you edited it with Notepad and saved it, its format changed to "UFT-8", which corrupts the text so it then fails to load properly...
                                        I will PM you a suitably encoded copy...
                                        Can I suggest you get "Notepad++" [free].
                                        It has special Ruby Syntax highlighting etc and you can set it to always open/save files with the right encoding...

                                        Thank you TIG,

                                        It works like a charm, and I will rush to get Notepad++ to avoid this in the future.

                                        Thanks again to both and have a fine day,
                                        Jesper

                                        HP ZBook 15, Windows 10 64 bit
                                        Intel Core i7-6820HQ @ 2.70GHz
                                        32 GB Ram
                                        NVIDIA Quadro M2000M

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

                                          @dave r said:

                                          Looks to me as if you haven't ticked the box for "Ruby Script Examples" in Window>Preferences>Extensions.

                                          it is ticked but the error message is the same!
                                          "Error Loading File attributes.rb
                                          undefined method `GetString' for nil:NilClass"

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

                                            This error message relates to the 'language handler' system tool...
                                            There would have been more text, you curtailed it just before the line number generating the error... 😒

                                            For example .GetString("Square meters"). That is looking up the 'translation' in the '.string' file.
                                            Have you edited the file ?
                                            Have you got any text reading something like .GetString() or .GetString(**nil**) or .GetString(**any_text_without_paired_quotes**)
                                            Is the .rb file still in "UTF-8 without BOM" encoding etc ??
                                            Check that with Notepad++...

                                            Just to double-check...
                                            Do you have a file named 'langhandler.rb' in the 'Tools' folder?
                                            If not you should !
                                            Try reinstalling/repairing Sketchup to get it back.
                                            If you have a similar file in the 'Plugins' folder then remove.
                                            Have you installed one of the older rogue compilation tool-bar scripts?
                                            These can come zipped with some older SketchUp 'system' files that then get installed into 'Plugins', whereby the correct [newer] ones Sketchup provides in 'Tools' get screwed !
                                            The files they can mess with include 'sketchup.rb', 'extensions.rb' and 'langhandler.rb'.
                                            If you have any of these in your Plugins folder remove them.
                                            If you do not have them in your Tools folder reinstall/repair Sketchup...

                                            TIG

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

                                            Advertisement