[chimerax-users] Hopefully simple plugin development question
Thomas Mulvaney
thomas.mulvaney at cssb-hamburg.de
Wed Apr 19 11:36:18 PDT 2023
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 at 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 at cgl.ucsf.edu <mailto:ChimeraX-users at cgl.ucsf.edu>
> Manage subscription:
> https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.rbvi.ucsf.edu/pipermail/chimerax-users/attachments/20230419/db655e58/attachment.html>
More information about the ChimeraX-users
mailing list