VisLoad

From PyMOLWiki
Jump to: navigation, search
Type Python Module
Download
Author(s) Jason Vertrees
License BSD

visLoad will load an object and show it in your desired representation. PyMOL by default loads things as lines (or spheres, a setting you may change), but not others.

Usage

The Code

import os
from os import path
from pymol import cmd
 
def visLoad(filename, object=None, *args, **kwargs):
        if object==None:
                object = os.path.basename(filename).split(".")[0]
        cmd.set("suspend_updates")
        try:
                cmd.load(filename, object, *args, **kwargs)
                cmd.show_as("cartoon", object)
        finally:
                cmd.set("suspend_updates", "off")
 
cmd.extend("visLoad", visLoad)

See Also

Load, Save, Show_as

Settings: auto_show_lines, auto_show_nonbonded, auto_show_spheres

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox