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")
閱讀更多 »
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")
閱讀更多 »