I understand that PyMOL strips characters like ( in the object name when loading in a new molecule object. However, since it is allowed to name objects "sele", this causes some behavioural issues if we have an object called "sele" in the session:
pymol.commanding.delete("sele") will delete the selection object "(sele)" first, before deleting a named object called "sele"
pymol.selecting.select(...) will raise pymol.CmdException: Error: name conflicts with an object if an object called "sele" is exists before the default selection object "(sele)" exists
In the dictionary returned by pymol.viewing.get_vis(), the key "sele" refers to a named object named "sele" if it exists, otherwise if it doesn't exist, it refers to the selection object "(sele)".
I'm guessing that the object name corrector which strips invalid characters also acts on arguments to pymol API functions like delete.
What I really wanted to do is to use pymol.viewing.get_vis() to check whether a named object is enabled or disabled (from the function pymol.viewing.enable/disable). Is there a better way to do this check?
I understand that PyMOL strips characters like
(
in the object name when loading in a new molecule object. However, since it is allowed to name objects "sele", this causes some behavioural issues if we have an object called "sele" in the session:pymol.commanding.delete("sele")
will delete the selection object"(sele)"
first, before deleting a named object called"sele"
pymol.selecting.select(...)
will raisepymol.CmdException: Error: name conflicts with an object
if an object called"sele"
is exists before the default selection object"(sele)"
existsIn the dictionary returned by
pymol.viewing.get_vis()
, the key"sele"
refers to a named object named"sele"
if it exists, otherwise if it doesn't exist, it refers to the selection object"(sele)"
.I'm guessing that the object name corrector which strips invalid characters also acts on arguments to pymol API functions like
delete
.What I really wanted to do is to use
pymol.viewing.get_vis()
to check whether a named object is enabled or disabled (from the functionpymol.viewing.enable/disable
). Is there a better way to do this check?