Dear friends,
unit = Sketchup.active_model.options["UnitsOptions"]["VolumeUnit"]
This code works well in WIN but returns nil in MAC OS. Any idea about the problem? Do you know any source for Ruby Sketchup in MAC OS?
Thank you in advance,
Dear friends,
unit = Sketchup.active_model.options["UnitsOptions"]["VolumeUnit"]
This code works well in WIN but returns nil in MAC OS. Any idea about the problem? Do you know any source for Ruby Sketchup in MAC OS?
Thank you in advance,
Are you sure it is because of the Mac? And not because of the different (earlier) version of SU used on Mac?
https://ruby.sketchup.com/Length.html
There is something else going on, perhaps the SketchUp version you tested on - as @dezmo noted. Although there are possibly some platform-specific bugs, the Ruby version and the Ruby API have been identical on Mac and Windows SketchUp for some time. The line of code you provided does not return nil on my Mac under SketchUp 2021.
It does return nil
in SU2019.1 on Windows.
Sketchup.version
>>19.1.174
Sketchup.active_model.options["UnitsOptions"]["VolumeUnit"].nil?
>>true
Thank you so much. My problem was Sketchup Version, not the operating system.