Method: Sketchup::Menu#add_item

Defined in:
lib/menu.rb

#add_item(menu_item) ⇒ menu_id #add_item(command) ⇒ menu_id

add_item may take 2 forms.

Overloads:

  • #add_item(menu_item) ⇒ menu_id

    Examples:

    menu = UI.menu("Plugins")
    menu_id = menu.add_item("Calculate Area"} { calc_area }

    Parameters:

    • menu_item (String)

      the name of the menu item, or a UI::Command object.

  • #add_item(command) ⇒ menu_id

    Examples:

    menu = UI.menu("Plugins")
    cmd = UI::Command.new("Calculate Area") { calc_area }
    menu_id = menu.add_item(cmd)

    Parameters:

Returns:

  • (menu_id)

    a unique numeric id number



20
21
# File 'lib/menu.rb', line 20

def add_item(item)
end