Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in volume formatting #3

Open
janbrouwer opened this issue Apr 2, 2015 · 7 comments
Open

Error in volume formatting #3

janbrouwer opened this issue Apr 2, 2015 · 7 comments
Labels

Comments

@janbrouwer
Copy link

Line 619: current_unit = Sketchup.format_area(0).match(/^0 (\S+) /)[1]
gives me an error: "Error: #<NoMethodError: undefined method `[]' for nil:NilClass>"

This seems to work for me:
current_unit = Sketchup.format_area(0)[2...-1]

Thanks for the great libraries btw!

@thomthom
Copy link
Owner

thomthom commented Apr 5, 2015

What model unit settings did you have?

@janbrouwer
Copy link
Author

Doesn't seem to matter, same result using mm and inches.

I'm feeding it: Volume.new( Float ).to_s

@thomthom
Copy link
Owner

thomthom commented Apr 7, 2015

Hmm... I see the error now - it's due to a change in SU2014.

In versions prior to SU2014 Sketchup.format_area(0) would yield: 0 Millimeters ²
As of SU2014 it yields 0 mm²

@thomthom thomthom added the bug label Apr 7, 2015
@thomthom
Copy link
Owner

thomthom commented Apr 7, 2015

Fixed in efd99a2

@thomthom thomthom closed this as completed Apr 7, 2015
@janbrouwer
Copy link
Author

Aha,
My solution seems to work for these two, but I'm not 100% sure if 0 would be the same in all cases, could there be an output of for example "0.000 meters"?

@janbrouwer
Copy link
Author

Great, thanks!

@thomthom
Copy link
Owner

thomthom commented Apr 7, 2015

hmm... maybe SketchUp would change at some point and return non-integer number... might be worth adding accounting for possible comma or period...

@thomthom thomthom reopened this Apr 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants