回到主页

SketchUP Ruby API:顶级命名空间

· 技术资料

命名空间下的定义

模块:

Geom/Geom

Layout

Sketchup

UI

类:

Array/Array

LanguageHandler/LanguageHandler

Length

Numeric

SketchupExtension

String

 

常量目录

SB_PROMPT

SB_VCB_LABEL

SB_VCB_VALUE

ORIGIN_2D

ORIGIN

X_AXIS_2D

Y_AXIS_2D

X_AXIS

Y_AXIS

Z_AXIS

IDENTITY

IDENTITY_2D

MB_OK

MB_OKCANCEL

MB_ABORTRETRYIGNORE

MB_YESNOCANCEL

MB_YESNO

MB_RETRYCANCEL

MB_MULTILINE

VK_SPACE

VK_PRIOR

VK_NEXT

VK_END

VK_HOME

VK_LEFT

VK_UP

VK_RIGHT

VK_DOWN

VK_INSERT

VK_DELETE

MF_ENABLED

MF_GRAYED

MF_DISABLED

MF_CHECKED

MF_UNCHECKED

VK_SHIFT

VK_CONTROL

VK_ALT

VK_COMMAND

VK_MENU

ALT_MODIFIER_KEY

ALT_MODIFIER_MASK

COPY_MODIFIER_KEY

COPY_MODIFIER_MASK

CONSTRAIN_MODIFIER_KEY

CONSTRAIN_MODIFIER_MASK

IDOK

IDCANCEL

IDABORT

IDRETRY

IDIGNORE

IDYES

IDNO

PAGE_USE_CAMERA

PAGE_USE_RENDERING_OPTIONS

PAGE_USE_SHADOWINFO

PAGE_USE_SKETCHCS

PAGE_USE_HIDDEN

PAGE_USE_HIDDEN_GEOMETRY

PAGE_USE_HIDDEN_OBJECTS

PAGE_USE_LAYER_VISIBILITY

PAGE_USE_SECTION_PLANES

PAGE_USE_ALL

PAGE_NO_CAMERA

DimensionArrowNone

DimensionArrowSlash

DimensionArrowDot

DimensionArrowClosed

DimensionArrowOpen

ALeaderNone

ALeaderView

ALeaderModel

GL_POINTS

GL_LINES

GL_LINE_LOOP

GL_LINE_STRIP

GL_TRIANGLES

GL_TRIANGLE_STRIP

GL_TRIANGLE_FAN

GL_QUADS

GL_QUAD_STRIP

GL_POLYGON

LAYER_VISIBLE_BY_DEFAULT

LAYER_HIDDEN_BY_DEFAULT

LAYER_USES_DEFAULT_VISIBILITY_ON_NEW_PAGES

LAYER_IS_VISIBLE_ON_NEW_PAGES

LAYER_IS_HIDDEN_ON_NEW_PAGES

CMD_SELECT

CMD_PAINT

CMD_ERASE

CMD_RECTANGLE

CMD_LINE

CMD_CIRCLE

CMD_ARC

CMD_POLYGON

CMD_FREEHAND

CMD_PUSHPULL

CMD_TEXT

CMD_MOVE

CMD_ROTATE

CMD_EXTRUDE

CMD_SCALE

CMD_OFFSET

CMD_MEASURE

CMD_PROTRACTOR

CMD_SKETCHCS

CMD_SECTION

CMD_DRAWOUTLINES

CMD_DRAWCUTS

CMD_ORBIT

CMD_DOLLY

CMD_ZOOM

CMD_ZOOM_WINDOW

CMD_ZOOM_EXTENTS

CMD_CAMERA_UNDO

CMD_WIREFRAME

CMD_HIDDENLINE

CMD_SHADED

CMD_TEXTURED

CMD_TRANSPARENT

CMD_WALK

CMD_PAN

CMD_MAKE_COMPONENT

CMD_DIMENSION

CMD_VIEW_ISO

CMD_VIEW_TOP

CMD_VIEW_FRONT

CMD_VIEW_RIGHT

CMD_VIEW_BACK

CMD_VIEW_LEFT

CMD_VIEW_BOTTOM

CMD_VIEW_PERSPECTIVE

CMD_POSITION_CAMERA

CMD_NEW

CMD_OPEN

CMD_SAVE

CMD_CUT

CMD_COPY

CMD_PASTE

CMD_DELETE

CMD_UNDO

CMD_REDO

CMD_PRINT

CMD_PAGE_NEW

CMD_PAGE_DELETE

CMD_PAGE_UPDATE

CMD_PAGE_NEXT

CMD_PAGE_PREVIOUS

CMD_RUBY_CONSOLE

CMD_SKETCHAXES

CMD_SHOWHIDDEN

CMD_SHOWHIDDENGEOMETRY

CMD_SHOWHIDDENOBJECTS

CMD_SHOWGUIDES

CMD_SELECTION_ZOOM_EXT

CMD_DISPLAY_FOV

TB_HIDDEN

TB_VISIBLE

TB_NEVER_SHOWN

TextAlignLeft

TextAlignRight

TextAlignCenter

TextVerticalAlignBoundsTop

TextVerticalAlignBaseline

TextVerticalAlignCapHeight

TextVerticalAlignCenter

SKETCHUP_CONSOLE

FILE_WRITE_OK

FILE_WRITE_FAILED_INVALID_TYPE

FILE_WRITE_FAILED_UNKNOWN

SnapTo_Arbitrary

SnapTo_Horizontal

SnapTo_Vertical

SnapTo_Sloped

实例方法

- **add_separator_to_menu**(menu_name) ⇒ [[Object]]

详情:自SketchUp 6.0起可用。

- **file_loaded(filename)** ⇒ [[Object]]

详情:在你需要加载的文件末尾调用这个方法以通知系统将这个文件标记为已加载的。
    
**示例代码**
    
```ruby
module Example
unless file_loaded?(__FILE__)
menu = UI.menu('Plugins')
menu.add_item('Example') { self.hello }
file_loaded(__FILE__)
end
    
def self.hello
puts 'Hello World'
end
    
end
```
    
    
    
- **file_loaded?**(filename) ⇒ Boolean

详情这个方法用于为你不想重复加载的代码创建一个load guards。
尤其常用于避免你的UI设定代码重复定义工具栏和菜单项。
 
**示例代码**
 
```ruby
module Example
unless file_loaded?(__FILE__)
menu = UI.menu('Plugins')
menu.add_item('Example') { self.hello }
file_loaded(__FILE__)
end
# 上面这段代码创建了一个load guard避免每次重复加载代码而定义复数个菜单选项
def self.hello
puts 'Hello World'
end

end
```
 
 
 
 

- **inputbox**(*args) ⇒ Object

这是[[UI.inputbox]]的一个封装。
    
调用它等同于调用[[UI.inputbox]]。

所有文章
×

还剩一步!

确认邮件已发至你的邮箱。 请点击邮件中的确认链接,完成订阅。

好的