is an API-only function which binds a new external function as a command into the PyMOL scripting language. In other words, when you write a function and want PyMOL to recognize the new command, you extend
the command into PyMOL. Once extended, the function name is recognized like other function names (example below). Typically, extend
is the last line of a PyMOL script.
cmd.extend(string name,function function)
def foo(moo=2): print moo
The following would now work within PyMOL:
Usage: foo [ moo ]
For security reasons, new PyMOL commands created using "extend" are not saved or restored in sessions.
You may want to set auto_arg to enable auto-completion for your command's arguments.