- modelList.add(new ChimeraModel("4zhp", ModelType.PDB_MODEL, 1, 0));
- return modelList; // ChimeraX doesn't have 'list models' command
- // List<String> list = sendChimeraCommand("list models type molecule",
- // true);
- // if (list != null)
- // {
- // for (String modelLine : list)
- // {
- // ChimeraModel chimeraModel = new ChimeraModel(modelLine);
- // modelList.add(chimeraModel);
- // }
- // }
- // return modelList;
+ String command = "list models type "
+ + (isChimeraX() ? "AtomicStructure" : "molecule");
+ List<String> list = sendChimeraCommand(command, true);
+ if (list != null)
+ {
+ for (String modelLine : list)
+ {
+ try
+ {
+ ChimeraModel chimeraModel = new ChimeraModel(modelLine);
+ modelList.add(chimeraModel);
+ } catch (NullPointerException e)
+ {
+ // hack for now
+ }
+ }
+ }
+ return modelList;