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

    [New scripter] Will need help on my project (now and then)

    已排程 已置頂 已鎖定 已移動 Developers' Forum
    21 貼文 6 Posters 2.0k 瀏覽 6 Watching
    正在載入更多貼文
    • 從舊到新
    • 從新到舊
    • 最多點贊
    回覆
    • 在新貼文中回覆
    登入後回覆
    此主題已被刪除。只有擁有主題管理權限的使用者可以查看。
    • Dan RathbunD 離線
      Dan Rathbun
      最後由 編輯

      @ruts said:

      In my calculations ... I want to use the base ruby class Matrix which is made for such operations. I found out that it's not just adding require 'matrix' to your code.

      Because SketchUp was not distributed with the Ruby Standard Library until version 2014.

      @ruts said:

      I did copy the matrix.rb and e2mmap.rb (which is required by matrix.rb) from the ruby2.2.2 folder ...

      This will not work, as you need to use the library compiled and distributed with the Ruby version that SketchUp uses. The constants RUBY_VERSION and RUBY_PATCHLEVEL typed at the console tell you what SketchUp embedded Ruby is.

      @ruts said:

      ... I believe this is the right way to require 'matrix'.

      Nope (when the standard library is properly installed,) just a simple require 'matrix' will do (because it will load it's own dependencies as it is evaluated.)

      @ruts said:

      I think I already have a solution for my problem.

      NO you don't, because you "don't have time to read the book," all this basic Ruby 101 knowledge is escaping you.

      So just go to my GitHub repo and get the Standard Ruby 1.8.6-p287 Library packaged for SketchUp 2013 and earlier on Windows ONLY.
      https://github.com/DanRathbun/sketchup-ruby186-stdlib-extension/releases/tag/2

      With SketchUp closed:
      (1) Put the RBZ archive someplace where you can navigate easily to it.
      (2) Delete any manually copied library files (such as those you mentioned copying above.)
      (3) Then start SketchUp 8 and use the manual "Install Extension ..." button from
      Window > Preferences > Extensions
      (3a) Navigate to where you saved the RBZ archive, and select it, click OK.

      (4) Open the console and test that the paths are correctly set in $LOAD_PATH (aka $:) by typing:
      puts $: and ENTER
      You should see a listing similar to:
      puts $:%(green)[C:/Program Files (x86)/SketchUp/SketchUp 8/Plugins C:/Program Files (x86)/SketchUp/SketchUp 8/Tools C:/Program Files (x86)/SketchUp/SketchUp 8/Plugins/Ruby186/lib/ruby/1.8 C:/Program Files (x86)/SketchUp/SketchUp 8/Plugins/Ruby186/lib/ruby/1.8/i386-mswin32 C:/Program Files (x86)/SketchUp/SketchUp 8/Plugins/Ruby186/lib/ruby/site_ruby/1.8 C:/Program Files (x86)/SketchUp/SketchUp 8/Plugins/Ruby186/lib/ruby/site_ruby/1.8/i386-msvcrt]nil

      The actual program files path might also look like:
      %(green)[C:/Program Files (x86)/Google/Google SketchUp 8/...]

      (5) Then further test the loading of "matrix.rb" via:
      require "matrix"
      You should see true returned.

      I'm not here much anymore.

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

      Advertisement