Area class messing up .volume
-
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?
-
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 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*.rbfiles 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... -
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.
-
ThomThom has an experimental script that defines
AreaandVolumeclasses.It is on his GitHub site.
https://github.com/thomthom/SketchUp-Units-and-Locale-Helper -
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#ifThey 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#ifActually I will do this earlier when I get width from the bounding box
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better š
Register LoginAdvertisement