# Align view to selected operator (numpad .) when scripting?

Whenever I hit Numpad. (align view to selection), it doesn't show up in the info panel. Is there an operator for this, so that I can use it in scripting?

• This could be phrased as a more general question since it applies to any menu item you want to know the python command to. – ideasman42 May 28 '13 at 10:59

The operator name is bpy.ops.view3d.view_selected(). See my answer here for additional information on this and also how to quickly reach the online manual and the API reference. Here are the accompanying docs for the operator.

Hover over a button and you should see a short description etc.. This can be useful for getting operator names.

You can go to the 3d view header and go to View > Align View > View Selected and check the operator name there.

## Copy To Clipboard

While your mouse is over the menu item you can press Ctrl + C and the Python command gets copied to the clipboard to save you retyping it.

## Log Everything

Some operators are excluded from the report window because typically you don't want setting the cursor (for example) to be logged, however this can be overridden by either...

• Starting blender with the command line argument --debug-wm
• Running this in the python console bpy.app.debug_wm = True

Then output of all operators executed will be logged in the info space and the console.

• I knew about the hover trick, but I couldn't find the "View Selected" operator in the view menu. – Daniel says Reinstate Monica May 28 '13 at 15:35
• You can also search in the Input tab of the user preferences if it has a hotkey – Greg Zaal May 28 '13 at 19:00