Module: AMS
- Defined in:
- ext-ruby/ams_lib/main.rb,
docs/ams.rb,
ext-ruby/ams_Lib.rb,
ext-ruby/ams_lib/translate.rb,
ext-ruby/ams_lib/extension_manager.rb
Overview
AMS is a top level namespace of AMS Library.
Defined Under Namespace
Modules: Cursor, DLL, Geometry, Group, Keyboard, Lib, MIDI, Menu, Registry, Screen, Sketchup, System, Timer, Window Classes: ExtensionManager, MultiLineText, SketchupObserver, Translate
Constant Summary collapse
- IS_PLATFORM_WINDOWS =
(RUBY_PLATFORM =~ /mswin|mingw/i ? true : false)
- IS_PLATFORM_OSX =
(RUBY_PLATFORM =~ /darwin/i ? true : false)
- IS_PLATFORM_LINUX =
(RUBY_PLATFORM =~ /linux/i ? true : false)
- IS_RUBY_VERSION_18 =
(RUBY_VERSION =~ /^1.8/ ? true : false)
- IS_RUBY_VERSION_20 =
(RUBY_VERSION =~ /^2.0/ ? true : false)
- IS_RUBY_VERSION_22 =
(RUBY_VERSION =~ /^2.2/ ? true : false)
- IS_RUBY_VERSION_25 =
(RUBY_VERSION =~ /^2.5/ ? true : false)
- IS_RUBY_VERSION_27 =
(RUBY_VERSION =~ /^2.7/ ? true : false)
- IS_SKETCHUP_64BIT =
((::Sketchup.respond_to?('is_64bit?') && ::Sketchup.is_64bit?) ? true : false)
- IS_SKETCHUP_32BIT =
!IS_SKETCHUP_64BIT
- SU_MAJOR_VERSION =
::Sketchup.version.to_i
Class Method Summary collapse
-
.clamp(val, min_val, max_val) ⇒ Numeric
Clamp value between minimum and maximum limits.
-
.clamp_int(value, min, max) ⇒ Integer
Clamp integer value between min and max.
-
.clamp_real(value, min, max) ⇒ Numeric
Clamp floating value between min and max.
-
.get_entity_by_id(id) ⇒ Sketchup::Entity?
Get entity by entity ID.
-
.get_folder_path(csidl) ⇒ String
Retrive a properly encoded path.
-
.get_top_entity_by_id(id) ⇒ Sketchup::Entity?
Get top level entity by entity ID.
-
.inspect_element(item) ⇒ Object
Convert a Ruby object to string that can be evaluated back into the same object.
-
.is_boolean?(object) ⇒ Boolean
Determine whether an object is a
true
orfalse
. -
.max(a, b) ⇒ Numeric
Get the maximum of two values.
-
.max_int(a, b) ⇒ Integer
Get the greatest of two integer values.
-
.max_real(a, b) ⇒ Numeric
Get the greatest of two floating values.
-
.min(a, b) ⇒ Numeric
Get the minimum of two values.
-
.min_int(a, b) ⇒ Integer
Get the least of two integer values.
-
.min_real(a, b) ⇒ Numeric
Get the least of two floating values.
-
.round(number, precision = 0) ⇒ Numeric
Round a numeric value to a particular number of decimal places.
-
.sign(val) ⇒ Integer
Get sign of a numeric value.
-
.sign_int(value) ⇒ Integer
Get sign of a integer value.
-
.sign_real(value) ⇒ Integer
Get sign of a floating value.
-
.validate_type(object, *types) ⇒ void
Validate object type.
Instance Method Summary collapse
Class Method Details
.clamp(val, min_val, max_val) ⇒ Numeric
Clamp value between minimum and maximum limits.
.clamp_int(value, min, max) ⇒ Integer
Clamp integer value between min and max.
.clamp_real(value, min, max) ⇒ Numeric
Clamp floating value between min and max.
.get_entity_by_id(id) ⇒ Sketchup::Entity?
Get entity by entity ID.
.get_folder_path(csidl) ⇒ String
Windows only!
Retrive a properly encoded path
.get_top_entity_by_id(id) ⇒ Sketchup::Entity?
Get top level entity by entity ID.
.inspect_element(item) ⇒ Object
Convert a Ruby object to string that can be evaluated back into the same object.
.is_boolean?(object) ⇒ Boolean
Determine whether an object is a true
or false
.
.max(a, b) ⇒ Numeric
Get the maximum of two values
.max_int(a, b) ⇒ Integer
Get the greatest of two integer values.
.max_real(a, b) ⇒ Numeric
Get the greatest of two floating values.
.min(a, b) ⇒ Numeric
Get the minimum of two values
.min_int(a, b) ⇒ Integer
Get the least of two integer values.
.min_real(a, b) ⇒ Numeric
Get the least of two floating values.
.round(number, precision = 0) ⇒ Numeric
Round a numeric value to a particular number of decimal places.
.sign(val) ⇒ Integer
Get sign of a numeric value.
.sign_int(value) ⇒ Integer
Get sign of a integer value.
.sign_real(value) ⇒ Integer
Get sign of a floating value.
.validate_type(object, *types) ⇒ void
This method returns an undefined value.
Validate object type.