首页/资讯/Ruby控制台的常用代码/
Ruby控制台的常用代码
2019-06-05 09:36:432448浏览
Ruby控制台的常用代码

ketchUp草图大师从4.0版本开始提供了Ruby接口,从此让SketchUp插入了腾飞的翅膀!目前,我们都可以“窗口”菜单下,找到“Ruby控制台”!

在“窗口”菜单下打开“Ruby控制台”后,就会弹出一个面板(如下图所示)。我们可以里里面输入各种ruby代码与SketchUp进行互动。

Ruby常用代码

比如,我们可以输入:puts”hello”,SketchUp也会回复你:hello。

Ruby控制台的常用代码

再比如,我们如何输入:Sketchup.send_action 10501的话,SketchUp的视图就会自动切换到顶视图。

Ruby控制台的常用代码

所以,如果您代码知识足够的话,是可以在Ruby控制台来完成很多工作的。下面和各位SketchUp爱好者分享一下常用的Rbuy代码。

常用代码:

操作步骤:打开SketchUp / 菜单栏“窗口”/ Ruby 控制台,输入 Sketchup.send_action加空格加5位代码 回车就可运行了。比如,“10501: (设置为顶视图)set view to Top”这个代码,我们就只要输入:Sketchup.send_action 10501并回车。

  1. 10501: (设置为顶视图)set view to Top

  2. 10502: (设置为前视图)set view to Front

  3. 10503: (设置为右视图)set view to Rear# 10504: (设置为左视图)set view to Left

  4. 10505: (设置为后视图)set view to Right# 10506: (设置为底视图)set view to Bottom

  5. 10507: (设置轴测视图)set view to Axonometric# 10508: (环绕观察工具)

  6. 10509: (缩放相机工具)# 10519: (设置为平行投影)set camera to ortho (removes perspective)

  7. 10521: (系统设置对话框)display the System Preferences dialog box (Files tab)

  8. 10522: (隐藏/显示红蓝绿轴)removes axes display

  9. 10523: (平移工具)pan

  10. 10525: (设置视线高度)set the interactive eye height feature

  11. 10526: (缩放窗口工具)zoom window# 10527: (充满视窗工具)zoom extents

  12. 10529: (返回上一次视图)zoom out 2

  13. 10531: (标准工具栏打/关)toggle the Standard toolbar

  14. 10532: (相机工具栏开/关)toggle the Camera toolbar

  15. 10533: (阴影设置对话框)display the Shadows Settings dialog box

  16. 10537: (视图工具栏开/关)toggle the Views toolbar

  17. 10538: (模型信息对话框)display the System Preferences dialog box (Display tab)

  18. 10545: (阴影开/关)toggle Color ByLayer

  19. 10546: (阴影工具栏开/关)toggle Shadows toolbar

  20. 10551: (工具图标放大/缩小)toogle Large icons# 10576: (样式工具栏开/关)toggle Render Mode toolbar

  21. 10596:(X 光模式显示)set Render Mode to No Transparency (Preferences)

  22. 10597: (线框模式显示)set Render Mode to Wire (Preferences)

  23. 10598: (消隐模式显示)set Render Mode to Transparency (Preferences)

  24. 10599: (着色模式显示)set Render Mode to Surfaces Shading (Preferences)

  25. 10600: (材质模式显示)set Render Mode to Texture (Preferences)

  26. 10601: (单色模式显示)set Render Mode to No Texture (Preferences)

  27. 10602: (阴影开/关)toggle Shadows

  28. 10603: (轮廓线开/关)toggle Profiles

  29. 10604: (扩展延长线开/关)toggle Extension Lines

  30. 10605: (抖动线开/关)toggle Jitter edges

  31. 10624:(打开隐藏相机设置面板)使用方法

  32. 21019: (橡皮工具)Hide Status bar and VCB

  33. 21020: (直线工具)Show Status bar and VCB

  34. 21022: (选择工具)Hide Status bar and VCB

  35. 21024: (测量工具)select the Measure tool

  36. 21031: (手绘线工具)select the Freehand Draw tool

  37. 21041: (推拉工具)select the PushPull tool

  38. 21048: (移动/复制工具)select the Move tool

  39. 21052: (隐藏选中的物体)hide selected objects

  40. 21056: (选中封闭的边线创建面)Create face with selected edges closed loop

  41. 21057: (量角器工具)select the Protactor tool

  42. 21060: (显示组件对话框)display Components Window

  43. 21061: (绘图工具栏栏开/关)toggle Draw toolbar# 21065: (圆弧工具)select the Arc tool

  44. 21067: (添加场景页面)creat a new Page

  45. 21074: (材质油漆桶工具)show the Materials Browser Window

  46. 21078: (删除场景页面)select the Paint Bucket tool

  47. 21080: (打开场景管理对话框)display the Page Manager Window

  48. 21094: (矩形工具)select the Rectangle tool

  49. 21095: (多边形工具)select the Polygon tool

  50. 21096: (绘圆工具)select the Circle tool

  51. 21098: (打开文件对话框)open the Open Window

  52. 21100: (偏移工具)select the Offset tool

  53. 21101: (全选)slect all objects

  54. 21124: (有效性检测报告)launch the validity check tool

  55. 21126: (坐标轴设置)select the Axes tool

  56. 21029: (旋转工具)select the Rotate tool

  57. 21032: (图层工具条开/关)toggle Layer toolbar

  58. 21169: (定位相机)select the Position Camera tool

  59. 21200: (插入2D图像对话框)display the Insert Image Window

  60. 21236: (比例缩放工具)select the Scale tool

  61. 21237: (导出2D图形对话框)display the Export 2D Graphics Window

  62. 21245: (多边形偏移系数)display a Polygon Offset Factors dialog box

  63. 21337: (剖面工具)select the Section Plane Placement tool

  64. 21354: (打开图层管理面板)open the Layer Window

  65. 21386: (导出场景动画对话框)open the Export Animation Window

  66. 21405: (文字标注工具)select the Text tool

  67. 21406: (雾化控制面板)display Fog dialog box

  68. 21410: (尺寸标注)select the Dim tool

  69. 21433: (编辑工具条开/关)toggle Edit toolbar

  70. 21442: (路径跟随工具)select the FollowMe tool

  71. 21460: (打开欢迎界面)display Licence

  72. 21466:(显示快速开始文件)display Quick reference Card in Adobe Reader

  73. 21477: (快捷键位表)List accelerators in window

  74. 21488: (图元信息面板)display Entity Info Window

  75. 21490:(柔化边线工具)display Soften Edges Window

  76. 21494: (相机视野)select Field of view tool

  77. 21513: (大纲管理面板)display a tree of the model with selectable items

Ruby控制台可以做很多事情,比如还可以检查插件报错原因。当一个插件不兼容SketchUp的时候,我们可以打开Ruby控制台,这时它就会提示一些错误原因。

注:更详细教程请查看 https://www.sketchupvray.com/2577.html


友情链接: