How to create and set a new menu block in some content region, programmatically I want to create a new menu programmatically add for him some elements and the activate it in some content region as a block. 

How can I do this programmatically? 

I know how to add for an existing menu new elements, but I don't know how to create a new menu.
You save the menu using menu_save:

$menu = array(
  'menu_name' =&gt; '',
  'title' =&gt; '',
  'description' =&gt; '',
);
menu_save($menu);


I'm not sure if there is an api function to activate a block, but it can be done, by inserting  a row in the blocks table. You need to know the module, delta, theme and region. For menus, the menu module will create one with the delta being the menu_name.

So with the above you could do something like this:

$menu_block = array(
  'module' =&gt; 'menu',
  'delta' =&gt; $menu['menu_name'],
  'theme' =&gt; '', // Either get the active theme or you can do it for all themes
  'region' =&gt; 'content', // Where you want to place it, theme dependant
  'status' =&gt; 1,
);


So while you can do it, you probably want to make this theme specific, or do this in an install profile, where you know which theme should be the active one etc.