| | 73 | === Model Types === |
| | 74 | |
| | 75 | Models types are Python classes. They all subclass from chimera.Model, but Python does not keep track of what classes subclass from a base class. The best you can do is to get a set of all the currently open model types. Keep in mind that a Chimera extension can introduce additional model types, so the set is always a subset. |
| | 76 | {{{ |
| | 77 | #!python |
| | 78 | modelTypes = [x.__class__ for x in chimera.openModels.list(all=True)] |
| | 79 | modelTypes = list(set(modelTypes)) |
| | 80 | for i, t in enumerate(modelTypes): |
| | 81 | modelTypes[i] = re.findall("_chimera[.](.*)[']", str(t))[0] |
| | 82 | }}} |
| | 83 | |
| | 84 | |