Module: MSPhysics::Dialog

Defined in:
RubyExtension/MSPhysics/dialog.rb

Overview

Since:

  • 1.0.0

Constant Summary

DEFAULT_EDITOR_THEME =

Since:

  • 1.0.0

'tomorrow_night'
DEFAULT_EDITOR_FONT =

Since:

  • 1.0.0

12
DEFAULT_EDITOR_WRAP =

Since:

  • 1.0.0

'free'
DEFAULT_EDITOR_PRINT_MARGIN =

Since:

  • 1.0.0

true
DEFAULT_EDITOR_SIZE =

Since:

  • 1.0.0

[800,600]
DEFAULT_DIALOG_HELP_BOX =

Since:

  • 1.0.0

true
DEFAULT_DIALOG_SCALE =

Since:

  • 1.0.0

1.0
USE_HTML_DIALOG =

~ Sketchup.version.to_i > 16 ? true : false

Since:

  • 1.0.0

false
PRECISION =

Since:

  • 1.0.0

3
TITLE =

Since:

  • 1.0.0

'MSPhysics UI'

Class Method Summary collapse

Class Method Details

.add_sound(path) ⇒ String

Add sound to UI.

Parameters:

  • path (String)

Returns:

  • (String)

    Name of added file.

Raises:

  • (TypeError)

    if file path is invalid.

  • (TypeError)

    if file is over 100 megabytes.

Since:

  • 1.0.0

.execute_js(code) ⇒ nil

Execute JavaScript in the UI dialog.

Parameters:

  • code (String)

Returns:

  • (nil)

Since:

  • 1.0.0

.fix_numeric_value(value) ⇒ String

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Remove uncertain decimal places.

Parameters:

  • value (Numeric)

Returns:

  • (String)

Since:

  • 1.0.0

.format_value(value, precision = 2) ⇒ String

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Format value into string.

Parameters:

  • value (Numeric)
  • precision (Fixnum) (defaults to: 2)

Returns:

  • (String)

Since:

  • 1.0.0

.get_joint_default_value(joint, attr_name) ⇒ Object?

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Get default value of a particular attribute in joint.

Parameters:

  • joint (Sketchup::Group, Sketchup::ComonentInstance)
  • attr_name (String)

Returns:

  • (Object, nil)

Since:

  • 1.0.0

.load_editor_settingsObject

Load editor settings from registry.

Since:

  • 1.0.0

.locate_error(error) ⇒ Boolean

Open MSPhysics UI and set pointer to the location of an error.

Parameters:

Returns:

  • (Boolean)

    success

Since:

  • 1.0.0

.open(state) ⇒ Boolean

Open/close MSPhysics UI.

Parameters:

  • state (Boolean)

Returns:

  • (Boolean)

    success

Since:

  • 1.0.0

.open?Boolean

Determine if MSPhysics UI is open.

Returns:

  • (Boolean)

Since:

  • 1.0.0

.remove_all_soundsObject

Remove all sounds from UI.

Since:

  • 1.0.0

.remove_sound(name) ⇒ Object

Remove sound from UI.

Parameters:

  • name (String)

Since:

  • 1.0.0

.save_editor_settingsObject

Save editor settings into registry.

Since:

  • 1.0.0

.update_body_statevoid

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method returns an undefined value.

Update UI properties tab.

Since:

  • 1.0.0

.update_dialog_styleBoolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Update dialog style.

Returns:

  • (Boolean)

    success

Since:

  • 1.0.0

.update_joint_statevoid

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method returns an undefined value.

Update UI joint tab.

Since:

  • 1.0.0

.update_simulation_slidersvoid

This method returns an undefined value.

Since:

  • 1.0.0

.update_simulation_statevoid

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method returns an undefined value.

Update UI simulation tab.

Since:

  • 1.0.0

.update_sound_statevoid

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method returns an undefined value.

Update UI sound tab.

Since:

  • 1.0.0

.update_statevoid

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method returns an undefined value.

Update state of all UI.

Since:

  • 1.0.0