Module: TT::SketchUp
- Defined in:
- TT_Lib2/sketchup.rb
Overview
Note:
Originally named TT::Sketchup
but renamed to
TT::SketchUp
to avoid
namespace confusion over Sketchup
for the TT
namespace. This was done in version 2.5.4.
Constant Summary
- COLOR_GL_POLYGON =
0
- COLOR_ALPHA =
1
- RAYTEST_WYSIWYG =
2
Class Method Summary collapse
- .activate_main_window ⇒ Object
- .newer_than?(min_major, min_minor, min_revision) ⇒ Boolean
- .refresh ⇒ Object
- .support?(feature_id) ⇒ Boolean
- .version ⇒ Object
Class Method Details
.activate_main_window ⇒ Object
88 89 90 91 92 93 94 95 96 |
# File 'TT_Lib2/sketchup.rb', line 88 def self.activate_main_window if TT::System::PLATFORM_IS_WINDOWS TT::Win32.activate_sketchup_window true else # Tough luck! :( false end end |
.newer_than?(min_major, min_minor, min_revision) ⇒ Boolean
54 55 56 57 58 59 60 |
# File 'TT_Lib2/sketchup.rb', line 54 def self.newer_than?(min_major, min_minor, min_revision) major, minor, revision = self.version return true if major > min_major return true if major == min_major && minor > min_minor return true if major == min_major && minor == min_minor && revision >= min_revision return false end |
.refresh ⇒ Object
74 75 76 77 78 79 80 81 82 |
# File 'TT_Lib2/sketchup.rb', line 74 def self.refresh if TT::System::PLATFORM_IS_WINDOWS TT::Win32.refresh_sketchup true else # Tough luck! :( false end end |
.support?(feature_id) ⇒ Boolean
38 39 40 41 42 43 44 45 46 47 |
# File 'TT_Lib2/sketchup.rb', line 38 def self.support?(feature_id) case feature_id when COLOR_GL_POLYGON, COLOR_ALPHA, RAYTEST_WYSIWYG # 4811 Windows # 4810 OSX self.newer_than?( 8,0,4810 ) end end |
.version ⇒ Object
66 67 68 |
# File 'TT_Lib2/sketchup.rb', line 66 def self.version Sketchup.version.split('.').map { |str| str.to_i } end |