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.

Since:

  • 2.5.0

Constant Summary

COLOR_GL_POLYGON =

Since:

  • 2.5.0

0
COLOR_ALPHA =

Since:

  • 2.5.0

1
RAYTEST_WYSIWYG =

Since:

  • 2.5.0

2

Class Method Summary collapse

Class Method Details

.activate_main_windowObject

Since:

  • 2.6.0



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

Returns:

  • (Boolean)

Since:

  • 2.5.0



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

.refreshObject

Since:

  • 2.5.0



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

Parameters:

  • feature_id (Symbol)

Returns:

  • (Boolean)

Since:

  • 2.5.0



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

.versionObject

Since:

  • 2.5.0



66
67
68
# File 'TT_Lib2/sketchup.rb', line 66

def self.version
  Sketchup.version.split('.').map { |str| str.to_i }
end