ModraUp Ruby API Documentation Ruby API Reference

Top Level Namespace

Constants # collapse

ORIGIN

ORIGIN = Geom::ORIGIN

Same as Geom::ORIGIN.

Returns:

  • (Geom::Point3d)

Examples:

ORIGIN.to_a  #=> [0.0, 0.0, 0.0]
X_AXIS

X_AXIS = Geom::X_AXIS

The same as Geom::X_AXIS.

Returns:

  • (Geom::Vector3d)

Examples:

X_AXIS.to_a  #=> [1.0, 0.0, 0.0]
Y_AXIS

Y_AXIS = Geom::Y_AXIS

The same as Geom::Y_AXIS.

Returns:

  • (Geom::Vector3d)

Examples:

Y_AXIS.to_a  #=> [0.0, 1.0, 0.0]
Z_AXIS

Z_AXIS = Geom::Z_AXIS

The same as Geom::Z_AXIS.

Returns:

  • (Geom::Vector3d)

Examples:

Z_AXIS.to_a  #=> [0.0, 0.0, 1.0]
IDENTITY

IDENTITY = Geom::IDENTITY

Is the same as Geom::IDENTITY.

Returns:

  • (Geom::Transformation)

Examples:

IDENTITY.identity?
SKETCHUP_CONSOLE

SKETCHUP_CONSOLE

ModraUp::Console singleton. It is the default target for $stdout / $stderr.

Returns:

  • (ModraUp::Console)

Examples:

SKETCHUP_CONSOLE.show
puts "hello"
FILE_WRITE_OK

FILE_WRITE_OK = 0

ModraUp::TextureWriter#write succeeded. Top-level constant.

Returns:

  • (Integer)

Examples:

FILE_WRITE_OK  #=> 0
FILE_WRITE_FAILED_INVALID_TYPE

FILE_WRITE_FAILED_INVALID_TYPE = 1

ModraUp::TextureWriter#write encountered an unsupported entity type. Top-level constant.

Returns:

  • (Integer)

Examples:

FILE_WRITE_FAILED_INVALID_TYPE  #=> 1
FILE_WRITE_FAILED_UNKNOWN

FILE_WRITE_FAILED_UNKNOWN = 2

ModraUp::TextureWriter#write failed due to various reasons such as not loaded or unable to write to the path. Top-level constant.

Returns:

  • (Integer)

Examples:

FILE_WRITE_FAILED_UNKNOWN  #=> 2
SB_PROMPT

SB_PROMPT = 0

ModraUp.set_status_text written to the left status bar prompt. Top-level constant.

Returns:

  • (Integer)

Examples:

SB_PROMPT  #=> 0
SB_VCB_VALUE

SB_VCB_VALUE = 1

ModraUp.set_status_text writes the VCB (Measurement Box) value. Top-level constant.

Returns:

  • (Integer)

Examples:

SB_VCB_VALUE  #=> 1
SB_VCB_LABEL

SB_VCB_LABEL = 2

ModraUp.set_status_text written to VCB label. Top-level constant.

Returns:

  • (Integer)

Examples:

SB_VCB_LABEL  #=> 2
MK_LBUTTON

MK_LBUTTON

Left mouse button pressed (tool flags). Top-level constant.

Returns:

  • (Integer)

Examples:

MK_LBUTTON  #=> 1(Windows)/ 2(macOS)
MK_RBUTTON

MK_RBUTTON

Right mouse button pressed. Top-level constant.

Returns:

  • (Integer)

Examples:

MK_RBUTTON  #=> 2(Windows)/ 8(macOS)
MK_SHIFT

MK_SHIFT

Shift is also CONSTRAIN_MODIFIER_MASK. Top-level constant.

Returns:

  • (Integer)

Examples:

MK_SHIFT  #=> 4(Windows)/ 131072(macOS)
MK_CONTROL

MK_CONTROL

Control. The COPY_MODIFIER_MASK on Windows. Top-level constant.

Returns:

  • (Integer)

Examples:

MK_CONTROL  #=> 8(Windows)/ 262144(macOS)
MK_MBUTTON

MK_MBUTTON

Middle mouse button pressed. Top-level constant.

Returns:

  • (Integer)

Examples:

MK_MBUTTON  #=> 16(Windows)/ 33554432(macOS)
MK_ALT

MK_ALT

Alt modifier. On macOS, this is COPY_MODIFIER_MASK. Top-level constant.

Returns:

  • (Integer)

Examples:

MK_ALT  #=> 32(Windows)/ 524288(macOS)
MK_COMMAND

MK_COMMAND = 1048576

Command (only macOS, consistent with SketchUp Mac). On macOS, this is ALT_MODIFIER_MASK. Top-level constant.

Returns:

  • (Integer)

Examples:

MK_COMMAND  #=> 1048576
CONSTRAIN_MODIFIER_MASK

CONSTRAIN_MODIFIER_MASK

Constraint Modifier Key Mask (Shift). Top-level constant. Matches SketchUp: Windows uses 4, macOS uses 131072 (NSEvent Shift bit).

Returns:

  • (Integer)

Examples:

(flags & CONSTRAIN_MODIFIER_MASK) != 0  # Shift held down
CONSTRAIN_MODIFIER_KEY

CONSTRAIN_MODIFIER_KEY

Constraint Modifier Key (Shift), equals VK_SHIFT. Top-level constant.

Returns:

  • (Integer)

Examples:

CONSTRAIN_MODIFIER_KEY == VK_SHIFT  #=> true
COPY_MODIFIER_MASK

COPY_MODIFIER_MASK

Copy modifier mask (macOS uses Option/Alt, others use Control). Top-level constant.

Returns:

  • (Integer)

Examples:

COPY_MODIFIER_MASK  #=> 8(Windows)/ 524288(macOS)
COPY_MODIFIER_KEY

COPY_MODIFIER_KEY

Copy modifier key (macOS as VK_ALT, others as VK_CONTROL). Top-level constant.

Returns:

  • (Integer)

Examples:

COPY_MODIFIER_KEY == VK_ALT || COPY_MODIFIER_KEY == VK_CONTROL
ALT_MODIFIER_MASK

ALT_MODIFIER_MASK

The Alt modifier key mask (Command on macOS). Top-level constant.

Returns:

  • (Integer)

Examples:

ALT_MODIFIER_MASK  #=> 32(Windows)/ 1048576(macOS)
ALT_MODIFIER_KEY

ALT_MODIFIER_KEY

The third modifier key (macOS as VK_COMMAND, others as VK_ALT). Top-level constant.

Returns:

  • (Integer)

Examples:

ALT_MODIFIER_KEY == VK_COMMAND || ALT_MODIFIER_KEY == VK_ALT
VK_SPACE

VK_SPACE = 32

Space virtual key code, for onKeyDown. Top-level constant.

Returns:

  • (Integer)

Examples:

VK_SPACE  #=> 32
VK_PRIOR

VK_PRIOR

Page Up. Top-level constant.

Returns:

  • (Integer)

Examples:

VK_PRIOR  #=> 33(Windows)/ 63276(macOS)
VK_NEXT

VK_NEXT

Page Down. Top-level constant.

Returns:

  • (Integer)

Examples:

VK_NEXT  #=> 34(Windows)/ 63277(macOS)
VK_END

VK_END

End. Top-level constant.

Returns:

  • (Integer)

Examples:

VK_END  #=> 35(Windows)/ 63275(macOS)
VK_HOME

VK_HOME

Home. Top-level constant.

Returns:

  • (Integer)

Examples:

VK_HOME  #=> 36(Windows)/ 63273(macOS)
VK_LEFT

VK_LEFT

Left arrow key. Top-level constant.

Returns:

  • (Integer)

Examples:

VK_LEFT  #=> 37(Windows)/ 63234(macOS)
VK_UP

VK_UP

Up arrow key. Top-level constant.

Returns:

  • (Integer)

Examples:

VK_UP  #=> 38(Windows)/ 63232(macOS)
VK_RIGHT

VK_RIGHT

Right arrow key. Top-level constant.

Returns:

  • (Integer)

Examples:

VK_RIGHT  #=> 39(Windows)/ 63235(macOS)
VK_DOWN

VK_DOWN

Down arrow key. Top-level constant.

Returns:

  • (Integer)

Examples:

VK_DOWN  #=> 40(Windows)/ 63233(macOS)
VK_INSERT

VK_INSERT = 45

Insert. Top-level constant.

Returns:

  • (Integer)

Examples:

VK_INSERT  #=> 45
VK_DELETE

VK_DELETE

Delete. Top-level constant.

Returns:

  • (Integer)

Examples:

VK_DELETE  #=> 46(Windows)/ 63272(macOS)
VK_SHIFT

Shift virtual key code, used with onKeyDown / onKeyUp. Top-level constant. As with SketchUp, the value varies by platform: Windows uses Win32 virtual key code, macOS uses NSEvent modifier keys.

Returns:

  • (Integer)

Examples:

VK_SHIFT  #=> 16(Windows)/ 131072(macOS)
VK_CONTROL

VK_CONTROL

Control. Top-level constant. As with SketchUp, its value varies by platform: Windows uses the Win32 virtual key code, while macOS uses the NSEvent modifier key.

Returns:

  • (Integer)

Examples:

VK_CONTROL  #=> 17(Windows)/ 262144(macOS)
VK_ALT

VK_ALT

Alt / Option。Top-level constant. As with SketchUp, its value varies by platform: Windows uses the Win32 virtual key code, while macOS uses the NSEvent modifier key.

Returns:

  • (Integer)

Examples:

VK_ALT  #=> 18(Windows)/ 524288(macOS)
VK_MENU

VK_MENU

Same as VK_ALT. Top-level constant. Like SketchUp, the value varies by platform: Windows uses the Win32 virtual key code, macOS uses the NSEvent modifier key.

Returns:

  • (Integer)

Examples:

VK_MENU  #=> 18(Windows)/ 524288(macOS)
VK_COMMAND

VK_COMMAND

Command(macOS)/ Left Windows Key. Top-level constant. As with SketchUp, the value varies by platform: Windows uses the Win32 virtual key code, while macOS uses the NSEvent modifier key.

Returns:

  • (Integer)

Examples:

VK_COMMAND  #=> 91(Windows)/ 1048576(macOS)
VK_ESCAPE

VK_ESCAPE = 27

Escape. Top-level constant; if onKeyDown returns true, then onCancel is not triggered.

Returns:

  • (Integer)

Examples:

VK_ESCAPE  #=> 27
SnapTo_Arbitrary

SnapTo_Arbitrary = 0

Same as ModraUp::SnapTo_Arbitrary.

Returns:

  • (Integer)
SnapTo_Horizontal

SnapTo_Horizontal = 1

Same as ModraUp::SnapTo_Horizontal.

Returns:

  • (Integer)
SnapTo_Vertical

SnapTo_Vertical = 2

Same as ModraUp::SnapTo_Vertical.

Returns:

  • (Integer)
SnapTo_Sloped

SnapTo_Sloped = 3

Same as ModraUp::SnapTo_Sloped.

Returns:

  • (Integer)
LAYER_VISIBLE_BY_DEFAULT

LAYER_VISIBLE_BY_DEFAULT = 0

ModraUp::Layer visibility in the scene: default display.

Returns:

  • (Integer)

Examples:

LAYER_VISIBLE_BY_DEFAULT  #=> 0
LAYER_HIDDEN_BY_DEFAULT

LAYER_HIDDEN_BY_DEFAULT = 1

ModraUp::Layer visibility in the scene: hidden by default.

Returns:

  • (Integer)

Examples:

LAYER_HIDDEN_BY_DEFAULT  #=> 1
LAYER_USES_DEFAULT_VISIBILITY_ON_NEW_PAGES

LAYER_USES_DEFAULT_VISIBILITY_ON_NEW_PAGES = 0

New scenes use default visibility.

Returns:

  • (Integer)

Examples:

LAYER_USES_DEFAULT_VISIBILITY_ON_NEW_PAGES  #=> 0
LAYER_IS_VISIBLE_ON_NEW_PAGES

LAYER_IS_VISIBLE_ON_NEW_PAGES = 16

Force the layer to be visible when a new scene is created.

Returns:

  • (Integer)

Examples:

LAYER_IS_VISIBLE_ON_NEW_PAGES  #=> 16
LAYER_IS_HIDDEN_ON_NEW_PAGES

LAYER_IS_HIDDEN_ON_NEW_PAGES = 32

Hide the layer by default in a new scene.

Returns:

  • (Integer)

Examples:

LAYER_IS_HIDDEN_ON_NEW_PAGES  #=> 32
PAGE_USE_CAMERA

PAGE_USE_CAMERA = 1

ModraUp::Page#update / ModraUp::Pages#add camera pose flag.

Returns:

  • (Integer)

Examples:

PAGE_USE_CAMERA  #=> 1
PAGE_USE_RENDERING_OPTIONS

PAGE_USE_RENDERING_OPTIONS = 2

Drawing style flag. The scene page does not temporarily save ModraUp::RenderingOptions separately.

Returns:

  • (Integer)

Examples:

PAGE_USE_RENDERING_OPTIONS  #=> 2
PAGE_USE_SHADOWINFO

PAGE_USE_SHADOWINFO = 4

Shadow setting flag. This kernel temporarily does not store ShadowInfo.

Returns:

  • (Integer)

Examples:

PAGE_USE_SHADOWINFO  #=> 4
PAGE_USE_SKETCHCS

PAGE_USE_SKETCHCS = 8

Axis flag. This kernel temporarily does not store Axes.

Returns:

  • (Integer)

Examples:

PAGE_USE_SKETCHCS  #=> 8
PAGE_USE_HIDDEN

PAGE_USE_HIDDEN = 16

Hides geometry and objects (SketchUp 2019 and earlier).

Returns:

  • (Integer)

Examples:

PAGE_USE_HIDDEN  #=> 16
PAGE_USE_LAYER_VISIBILITY

PAGE_USE_LAYER_VISIBILITY = 32

Layer visibility flag.

Returns:

  • (Integer)

Examples:

PAGE_USE_LAYER_VISIBILITY  #=> 32
PAGE_USE_SECTION_PLANES

PAGE_USE_SECTION_PLANES = 64

Section flag. This nucleus temporarily does not store sections.

Returns:

  • (Integer)

Examples:

PAGE_USE_SECTION_PLANES  #=> 64
PAGE_USE_HIDDEN_GEOMETRY

PAGE_USE_HIDDEN_GEOMETRY = 128

Hidden Geometry (SketchUp 2020+).

Returns:

  • (Integer)

Examples:

PAGE_USE_HIDDEN_GEOMETRY  #=> 128
PAGE_USE_HIDDEN_OBJECTS

PAGE_USE_HIDDEN_OBJECTS = 256

Use hidden groups/components (SketchUp 2020+).

Returns:

  • (Integer)

Examples:

PAGE_USE_HIDDEN_OBJECTS  #=> 256
PAGE_USE_ENVIRONMENT

PAGE_USE_ENVIRONMENT = 512

Environment light flag. This nucleus temporarily does not store Environment.

Returns:

  • (Integer)

Examples:

PAGE_USE_ENVIRONMENT  #=> 512
PAGE_USE_ALL

PAGE_USE_ALL = 4294967295

All scene properties.

Returns:

  • (Integer)

Examples:

(PAGE_USE_CAMERA | PAGE_USE_LAYER_VISIBILITY) != 0
TextAlignLeft

TextAlignLeft = 0

Left-aligned horizontally. Used for the :align in ModraUp::View#draw_text.

Returns:

  • (Integer)

Examples:

TextAlignLeft  #=> 0
TextAlignCenter

TextAlignCenter = 1

Horizontal center alignment.

Returns:

  • (Integer)

Examples:

TextAlignCenter  #=> 1
TextAlignRight

TextAlignRight = 2

Align text to the right horizontally.

Returns:

  • (Integer)

Examples:

TextAlignRight  #=> 2
TextVerticalAlignBoundsTop

TextVerticalAlignBoundsTop = 0

Align vertically to the top of the text bounds. Used for the :vertical_align in ModraUp::View#draw_text.

Returns:

  • (Integer)

Examples:

TextVerticalAlignBoundsTop  #=> 0
TextVerticalAlignBaseline

TextVerticalAlignBaseline = 1

Align text vertically to the baseline.

Returns:

  • (Integer)

Examples:

TextVerticalAlignBaseline  #=> 1
TextVerticalAlignCapHeight

TextVerticalAlignCapHeight = 2

Align text vertically to the cap height.

Returns:

  • (Integer)

Examples:

TextVerticalAlignCapHeight  #=> 2
TextVerticalAlignCenter

TextVerticalAlignCenter = 3

Align text vertically to the center of the first line height.

Returns:

  • (Integer)

Examples:

TextVerticalAlignCenter  #=> 3
ALeaderNone

ALeaderNone = 0

No leader line: the label sits on its point.

Returns:

  • (Integer)

Examples:

ALeaderNone  #=> 0
ALeaderView

ALeaderView = 1

View-based leader (Text#leader_type).

Returns:

  • (Integer)

Examples:

ALeaderView  #=> 1
ALeaderModel

ALeaderModel = 2

Model-based (pushpin) leader (Text#leader_type).

Returns:

  • (Integer)

Examples:

ALeaderModel  #=> 2
GL_POINTS

GL_POINTS = 0

ModraUp::View#draw entity type: points.

Returns:

  • (Integer)

Examples:

GL_POINTS  #=> 0
GL_LINES

GL_LINES = 1

ModraUp::View#draw entity type: line pairs.

Returns:

  • (Integer)

Examples:

GL_LINES  #=> 1
GL_LINE_LOOP

GL_LINE_LOOP = 2

ModraUp::View#draw element type: closed line loop.

Returns:

  • (Integer)

Examples:

GL_LINE_LOOP  #=> 2
GL_LINE_STRIP

GL_LINE_STRIP = 3

ModraUp::View#draw element type: line strip.

Returns:

  • (Integer)

Examples:

GL_LINE_STRIP  #=> 3
GL_TRIANGLES

GL_TRIANGLES = 4

ModraUp::View#draw primitive type: triangle.

Returns:

  • (Integer)

Examples:

GL_TRIANGLES  #=> 4
GL_TRIANGLE_STRIP

GL_TRIANGLE_STRIP = 5

ModraUp::View#draw primitive type: triangle strip.

Returns:

  • (Integer)

Examples:

GL_TRIANGLE_STRIP  #=> 5
GL_TRIANGLE_FAN

GL_TRIANGLE_FAN = 6

ModraUp::View#draw primitive type: triangle fan.

Returns:

  • (Integer)

Examples:

GL_TRIANGLE_FAN  #=> 6
GL_QUADS

GL_QUADS = 7

ModraUp::View#draw primitive type: quadrilateral.

Returns:

  • (Integer)

Examples:

GL_QUADS  #=> 7
GL_QUAD_STRIP

GL_QUAD_STRIP = 8

ModraUp::View#draw primitive type: quad strip.

Returns:

  • (Integer)

Examples:

GL_QUAD_STRIP  #=> 8
GL_POLYGON

GL_POLYGON = 9

ModraUp::View#draw element type: polygon.

Returns:

  • (Integer)

Examples:

GL_POLYGON  #=> 9
MF_ENABLED

MF_ENABLED = 0

Menu/Command Enablement: Enabled. Top-level constant.

Returns:

  • (Integer)

Examples:

MF_ENABLED  #=> 0
MF_GRAYED

MF_GRAYED = 1

Menu/Command Enable State: Grayed.

Returns:

  • (Integer)

Examples:

MF_GRAYED  #=> 1
MF_DISABLED

MF_DISABLED = 2

Menu/Command Enablement: Disabled.

Returns:

  • (Integer)

Examples:

MF_DISABLED  #=> 2
MF_CHECKED

MF_CHECKED = 8

Menu/Command Check: Checked.

Returns:

  • (Integer)

Examples:

MF_CHECKED  #=> 8
MF_UNCHECKED

MF_UNCHECKED = 0

Menu/Command Check: Not Checked (same value as MF_ENABLED).

Returns:

  • (Integer)

Examples:

MF_UNCHECKED  #=> 0
TB_HIDDEN

Top level TB_HIDDEN, with the same value as UI::TB_HIDDEN.

Returns:

  • (Integer)

Examples:

TB_HIDDEN  #=> 0
TB_VISIBLE

Top level TB_VISIBLE.

Returns:

  • (Integer)

Examples:

TB_VISIBLE  #=> 1
TB_NEVER_SHOWN

Top level TB_NEVER_SHOWN.

Returns:

  • (Integer)

Examples:

TB_NEVER_SHOWN  #=> -1
MB_OK

Top level MB_OK.

Returns:

  • (Integer)

Examples:

MB_OK  #=> 0
MB_OKCANCEL

Top level MB_OKCANCEL.

Returns:

  • (Integer)

Examples:

MB_OKCANCEL  #=> 1
MB_ABORTRETRYIGNORE

Top MB_ABORTRETRYIGNORE.

Returns:

  • (Integer)

Examples:

MB_ABORTRETRYIGNORE  #=> 2
MB_YESNOCANCEL

Top level MB_YESNOCANCEL.

Returns:

  • (Integer)

Examples:

MB_YESNOCANCEL  #=> 3
MB_YESNO

Top level MB_YESNO.

Returns:

  • (Integer)

Examples:

MB_YESNO  #=> 4
MB_RETRYCANCEL

Top-level MB_RETRYCANCEL.

Returns:

  • (Integer)

Examples:

MB_RETRYCANCEL  #=> 5
MB_MULTILINE

Top level MB_MULTILINE.

Returns:

  • (Integer)

Examples:

MB_MULTILINE  #=> 6
IDOK

Top level IDOK.

Returns:

  • (Integer)

Examples:

IDOK  #=> 1
IDCANCEL

Top-Level IDCANCEL.

Returns:

  • (Integer)

Examples:

IDCANCEL  #=> 2
IDABORT

Top level IDABORT.

Returns:

  • (Integer)

Examples:

IDABORT  #=> 3
IDRETRY

Top-level IDRETRY.

Returns:

  • (Integer)

Examples:

IDRETRY  #=> 4
IDIGNORE

Top Level IDIGNORE.

Returns:

  • (Integer)

Examples:

IDIGNORE  #=> 5
IDYES

Top level IDYES.

Returns:

  • (Integer)

Examples:

IDYES  #=> 6
IDNO

Top Level IDNO.

Returns:

  • (Integer)

Examples:

IDNO  #=> 7