Barry,

The shell tool is under Tools -> General on the ChimeraX menu. There's some API documentation online here: https://www.cgl.ucsf.edu/chimerax/docs/devel/index.html.

Models should also have an 'opened_data_format' attribute with info about which file parser was used (e.g. model.opened_data_format.name). This could be one way to limit models to only PDB or whatever you'd be able to support.

Tony

On Wed, Apr 19, 2023 at 12:57 PM BARRY E DEZONIA via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
Thanks Tom,

How do you invoke this python shell? A quick google search turns up nothing. The command line in the chimerax app does not allow tab completion. I've tried running 'chimerax --nogui' from the command line and that gives me a shell but no tab completion is possible there either.

From: Thomas Mulvaney <thomas.mulvaney@cssb-hamburg.de>
Sent: Wednesday, April 19, 2023 1:36 PM
To: BARRY E DEZONIA <barry.dezonia@wisc.edu>
Cc: chimerax-users@cgl.ucsf.edu <chimerax-users@cgl.ucsf.edu>
Subject: Re: [chimerax-users] Hopefully simple plugin development question
 
Hi Barry,

The list of current models the user is viewing is in the `session.models` variable.

Assuming the user has only one PDB file open, you can just do `session.models[0].filename` which will return the path to the PDB file they opened.

I've discovered most of the functionality I needed by poking around in the Python Shell that ships with ChimeraX and hitting tab to find out the attributes and methods that objects have.

Hope that helps,

Tom

Tom Mulvaney
PhD Student 
Centre for Structural Systems Biology (CSSB)
Research Group of Prof. Dr. Maya Topf
c/o DESY, Building 15
Notkestraße 85, 22607 Hamburg
Germany

On 19. Apr 2023, at 20:05, BARRY E DEZONIA via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:

Hello,

I am looking at writing a plugin for chimerax that takes a pdb and runs some python code that will calc some stuff hand stuff to other programs. I know how to do this. What I want to know is how to find the current model's name / associated pdb filename from my plugin. Imagine my plugin really is just a "Run" button that looks up the current model, generates the associated pdb filename, and passes that name to my python script. Can someone tell me how in a chimerax plugin I can make the call that will give me the pdb filename I want? I've read much of the developer docs and could not find what I was looking for.
_______________________________________________
ChimeraX-users mailing list
ChimeraX-users@cgl.ucsf.edu
Manage subscription:
https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users

_______________________________________________
ChimeraX-users mailing list
ChimeraX-users@cgl.ucsf.edu
Manage subscription:
https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users