build your own custom menu_bar in sketchUP 8
icon png file and ruby file put in Your_sketchup_install_dir/Plugins/m/
FILE: tool_bar_test.rb
puts("start tool_bar_test")
toolbar = UI::Toolbar.new "tool_my_bar"
cmd = UI::Command.new("xyz_cmd 1") {
Sketchup.send_action("selectDimensionTool:")
# UI.messagebox "exe cmd 1"
}
path="Plugins/m/"
ic_1 = "reset_16.png"
ic_2 = "reset_24.png"
small=Sketchup.find_support_file(ic_1 ,path)
large=Sketchup.find_support_file(ic_2 ,path)
cmd.small_icon = small
cmd.large_icon = large
cmd.tooltip = "I am cmd 1"
cmd.status_bar_text = "st I am cmd 1"
cmd.menu_text = "cmd 1 txt"
toolbar = toolbar.add_item cmd
cmd2 = UI::Command.new("xyz_cmd 2") {
UI.messagebox "ver [004] exe cmd2"
}
# ic_1 = "northtool_small.png"
# ic_2 = "northtool.png"
small=Sketchup.find_support_file(ic_1 ,path)
large=Sketchup.find_support_file(ic_2 ,path)
cmd2.small_icon = small
cmd2.large_icon = large
cmd2.tooltip = "Test cmd2"
cmd2.status_bar_text = "st I am cmd2"
cmd2.menu_text = "cmd 2 txt"
toolbar = toolbar.add_item cmd2
toolbar.show
puts(cmd.small_icon)
puts(cmd.large_icon)
puts("end tool_bar_test")
Valid actions are:
FILE: tool_bar_test.rb
require 'sketchup.rb'
puts("start tool_bar_test")
toolbar = UI::Toolbar.new "tool_my_bar"
cmd = UI::Command.new("xyz_cmd 1") {
Sketchup.send_action("selectDimensionTool:")
# UI.messagebox "exe cmd 1"
}
path="Plugins/m/"
ic_1 = "reset_16.png"
ic_2 = "reset_24.png"
small=Sketchup.find_support_file(ic_1 ,path)
large=Sketchup.find_support_file(ic_2 ,path)
cmd.small_icon = small
cmd.large_icon = large
cmd.tooltip = "I am cmd 1"
cmd.status_bar_text = "st I am cmd 1"
cmd.menu_text = "cmd 1 txt"
toolbar = toolbar.add_item cmd
cmd2 = UI::Command.new("xyz_cmd 2") {
UI.messagebox "ver [004] exe cmd2"
}
# ic_1 = "northtool_small.png"
# ic_2 = "northtool.png"
small=Sketchup.find_support_file(ic_1 ,path)
large=Sketchup.find_support_file(ic_2 ,path)
cmd2.small_icon = small
cmd2.large_icon = large
cmd2.tooltip = "Test cmd2"
cmd2.status_bar_text = "st I am cmd2"
cmd2.menu_text = "cmd 2 txt"
toolbar = toolbar.add_item cmd2
toolbar.show
puts(cmd.small_icon)
puts(cmd.large_icon)
puts("end tool_bar_test")
use load to test ====> load 'm/tool_bar_test.rb'
Valid actions are:
- showRubyPanel:
- viewBack:
- viewBottom:
- viewFront:
- viewIso:
- viewLeft:
- viewRight:
- viewTop:
- viewPerspective:
- viewShowAxes:
- viewShowHidden:
- viewZoomExtents:
- viewZoomToSelection:
- viewUndo:
- selectOrbitTool:
- selectPositionCameraTool:
- selectDollyTool:
- selectTurnTool:
- selectWalkTool:
- selectZoomTool:
- selectFieldOfViewTool:
- selectZoomWindowTool:
- pageAdd:
- pageDelete:
- pageUpdate:
- pageNext:
- pagePrevious:
- renderWireframe:
- renderHiddenLine:
- renderMonochrome:
- renderShaded:
- renderTextures:
- selectArcTool:
- selectArc3PointTool:
- selectArc3PointPieTool:
- selectAxisTool:
- selectCircleTool:
- selectEraseTool:
- selectFreehandTool:
- selectLineTool:
- selectMeasureTool:
- selectMoveTool:
- selectOffsetTool:
- selectPaintTool:
- selectPolygonTool:
- selectProtractorTool:
- selectPushPullTool:
- selectRectangleTool:
- selectRectangle3PointTool:
- selectRotateTool:
- selectScaleTool:
- selectSectionPlaneTool:
- selectTextTool:
- selectDimensionTool:
- selectExtrudeTool:
- selectSelectionTool:
- editUndo:
- editRedo:
- editHide:
- editUnhide:
- fixNonPlanarFaces:
0 個意見:
張貼留言
訂閱 張貼留言 [Atom]
<< 首頁