• Login
sketchucation logo sketchucation
  • Login
🔌 Quick Selection | Try Didier Bur's reworked classic extension that supercharges selections in SketchUp Download

Area class messing up .volume

Scheduled Pinned Locked Moved Developers' Forum
6 Posts 3 Posters 557 Views 3 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.
  • A Offline
    Al Hart
    last edited by 17 Sept 2015, 17:11

    We have a plugin which uses .volume on entities but for one user is returning a value of the class Area rather than a number.

    Is anyone aware of a plugin which defines Area or which overrides Entity.volume?

    Al Hart

    http:wiki.renderplus.comimageseefRender_plus_colored30x30%29.PNG
    IRender nXt from Render Plus

    1 Reply Last reply Reply Quote 0
    • A Offline
      Al Hart
      last edited by 17 Sept 2015, 21:00

      Does anyone know how to determine which .rb file defined a class, or a good way to search all .rb files in Plugins folder, or in all of windows to see which ones contain 'Class Area' or 'Area' (starting with a capital letter)?

      Then I could narrow things down.

      Al Hart

      http:wiki.renderplus.comimageseefRender_plus_colored30x30%29.PNG
      IRender nXt from Render Plus

      1 Reply Last reply Reply Quote 0
      • T Offline
        TIG Moderator
        last edited by 18 Sept 2015, 13:04

        @al hart said:

        Does anyone know how to determine which .rb file defined a class, or a good way to search all .rb files in Plugins folder, or in all of windows to see which ones contain 'Class Area' or 'Area' (starting with a capital letter)?
        Then I could narrow things down.
        If it's in an RBS we're screwed, but assuming it's in an RB I would use BareGrep*** - to search the Plugins folder and subfolders for file type *.rb files and a string - say " class Area"

        *** http://www.baremetalsoft.com/baregrep/
        Baregrep is very useful tool for finding matching text strings in all file types with a folder and nested subfolders...

        TIG

        1 Reply Last reply Reply Quote 0
        • A Offline
          Al Hart
          last edited by 18 Sept 2015, 13:40

          By disabling extensions one at a time, it looks like the problem is caused by DesignPH.

          Almost all the rubies ae .RBS

          I'll contact them and see if they can help.

          Al Hart

          http:wiki.renderplus.comimageseefRender_plus_colored30x30%29.PNG
          IRender nXt from Render Plus

          1 Reply Last reply Reply Quote 0
          • D Offline
            Dan Rathbun
            last edited by 20 Sept 2015, 17:05

            ThomThom has an experimental script that defines Area and Volume classes.

            It is on his GitHub site.
            https://github.com/thomthom/SketchUp-Units-and-Locale-Helper

            I'm not here much anymore.

            1 Reply Last reply Reply Quote 0
            • A Offline
              Al Hart
              last edited by 29 Sept 2015, 15:09

              It turns out the the other developer had defined a override to Length which returned a value of class Area when 2 lengths were multiplied.

              We were multiplying the bounding box extrema to try to calculate an approximate volume if volume was not defined.

              if (entity.respond_to?(:volume)) rval = entity.volume else rval = bwidth * bdepth * bheight end#if

              They plan to fix it, but I think I can coerce each "length" to a float before multiplying them:

              if (entity.respond_to?(:volume)) rval = entity.volume else rval = bwidth.to_f * bdepthto_f * bheightto_f end#if

              Actually I will do this earlier when I get width from the bounding box

              Al Hart

              http:wiki.renderplus.comimageseefRender_plus_colored30x30%29.PNG
              IRender nXt from Render Plus

              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